babel, frenchb and em dash

If I'm not wrong, in French the em-dashes, typeset with --- in LaTeX, are usually treated like the guillemets as far as non-breaking spaces go. An "opening" em-dash must be followed by a non-breaking space, while a "closing" em-dash must be preceded by a non-breaking space.

[french]{babel} doesn't apply this rule, so I ended up making my own macros:

\newcommand{\ocadr}{\mbox{---~}}


Is there a better way to ensure these non-breaking spaces?

Edit:

Here is a minimal example to justify the use of \mbox:

\documentclass{minimal}

\begin{document}

\parbox{9cm}{\textsc{
Dieu se sert des epreuves pour nous montrer nos c\oe{}urs,
afin de pouvoir nous purifier et nous faire ensuite entrer
dans le pays de la benediction ---~physiquement et spirituellement.
}}

\end{document}


which produces:

Whereas with \mbox around the ---~, I get:

Nota:

I kept the \textsc because it's a case that I know produces this effect with the given size of the \parbox.

-
I suspect that 'cadratin' is a French term: looks like an em-dash to me. – Joseph Wright Apr 19 '11 at 14:27
Right, that'll be clearer, thanks. – ℝaphink Apr 19 '11 at 14:35
I was always understood that in french typography it is space, en dash, space (i.e, em dash is not normally used). – Yiannis Lazarides Apr 19 '11 at 15:39
@Yiannis: according to Wikipedia (fr.wikipedia.org/wiki/Tiret#Tiret_long, in French), em dash has to be used, but en dash is sometimes preferred (although the source for that is missing in the article). – ℝaphink Apr 19 '11 at 15:47
OK, I see where the break is coming from. I've updated my answer: I would keep only the necessary material inside a box. – Joseph Wright Apr 19 '11 at 17:14

I see that the \mbox is needed as the ligature inserts a \discretionary. However, I'd keep the space out of the box if I were you. So

\newcommand*{\ocadr}{\mbox{---}~}

using the primitives \unskip to avoid any additional space (the opening macro should skip spaces in any case) and the \mbox to prevent a break after the opening material would seem best.
I added an \mboxbecause I had a case were a newline was added right after the em in spite of the non-breaking space. – ℝaphink Apr 19 '11 at 14:43
@Raphink: In that case, use \mbox{---}\nobreak\,\nobreak to ensure that the em-dash sticks to the following material. – Joseph Wright Apr 19 '11 at 18:16