[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `@code` doesn't allow line break after first `-`
From: |
Gavin Smith |
Subject: |
Re: `@code` doesn't allow line break after first `-` |
Date: |
Fri, 13 Jan 2023 21:12:54 +0000 |
On Thu, Jan 12, 2023 at 07:34:23AM +0000, Werner LEMBERG wrote:
>
> >> However, I've tried to fix it in commit bdb7f23072 (texinfo.tex
> >> version 2023-01-11.18).
> >
> > It works, thanks!
>
> Mhmm, more tests show that for `@code{foo--bar}` there is no
> `@discretionary` after the two hyphens. Is this intentional?
Yes, it is. This was to stop hyphenation in @option{--option}.
> Additionally, I wonder whether the same logic should be applied to
> `_`. If you want to document, say, C prepocessor symbols, you will
> have tokens like `_foo` or `__foo_bar`, and `texinfo.tex` happily
> inserts `@discretionary` after all of those underline characters.
That would make sense. There is a comment:
% An additional complication: the above will allow breaks after, e.g.,
% each of the four underscores in __typeof__. This is bad.
% @allowcodebreaks provides a document-level way to turn breaking at -
% and _ on and off.
but it would make sense to do the same thing for _ as for -.