Markus Kuhn's UTF-8 and Unicode FAQ:
http://www.cl.cam.ac.uk/~mgk25/unicode.html
How can I achieve this output *automatically*?
For TeX, only:
Markus Kuhn's UTF-8 and Unicode FAQ: @h...@penalty9000@hfilneg
@url{http://www.cl.cam.ac.uk/~mgk25/unicode.html}
(The 9000 is more or less random; I get the same results with any
positive number <10000. Any negative penalty and the break is taken
there even if the url would fit on the line.)
Here is the explanation (taken from Knuth):
If a break is taken at the \penalty, the preceding \hfil will fill the
line with blank space, and the \hfilneg will be discarded after the
break; but if no break is taken at the penalty, the \hfil| and
\hfilneg will cancel each other and have no effect.
(\hfilneg is equivalent to \hskip 0pt plus -1fil, while \hfil is
equivalent to \hskip 0pt plus 1fil.)
There is no way to do this in Info or HTML or anything else.
Alternatives:
1) use @* after all and deal with rewriting when and if needed.
2) use @/ within the @url to allow line breaks.
3) use the @raggedright environment (in the next release), since any
such brief paragraph with long url's is unlikely to be justifiable.
In other words, is there a way for TeX to consider to put a \hfil\break,
with a smaller penalty than the one that would apply for a \break ?
Just in case you aren't aware, \break is an abbreviation for
\penalty-10000.
Best,
karl