groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Differences in `ne` and `bp` line-breaking behavior


From: onf
Subject: Differences in `ne` and `bp` line-breaking behavior
Date: Sun, 01 Dec 2024 23:06:41 +0100

Hi all,

I have discovered recently that `ne` and `bp` behave differently in
regards to pending input lines. `bp` breaks such lines, while `ne`
does not. In practice this means that `ne` does not behave like a
conditional `bp` as one would reasonably expect. This issue has been
discussed extensively on groff's bug tracker.[1]

I propose the following changes to make their behavior consistent:

 1. `ne` breaks line before breaking the page as `bp` does
 2. `ne` does not break line before breaking the page if called with
    the no-break control character (which currently doesn't modify
    its behavior in any way)

The second point means that the old behavior of .ne can be recovered
via 'ne. This matches the behavior of 'bp, which breaks page without
breaking the line as well.

Note that this change would break compatibility with other troff
implementations. However, it would be easy to fix any documents
which rely on the current behavior by substituting[2] any .ne
for 'ne, which, as pointed out above, behaves exactly like .ne
in other troff implementations.

I invite anyone who disagrees with this proposal to raise any
objections they might have, either here or on the bug tracker.

~ onf

[1] https://savannah.gnu.org/bugs/?66447

[2] sed -Ei 
"s/^\\.([[:blank:]]*)ne([[:blank:]]+)|^([.'][[:blank:]]*(i[fe].*|el)[[:blank:]]+)\\.([[:blank:]]*)ne([[:blank:]]+)/\\3'\\1\\5ne\\2\\6/"
 $(find -name '*.tr' -or -name '*.tmac')

    This can handle .ne in if/ie/el one-liners and any whitespace
    between the control character and the `ne`. I have tested it
    quite a bit, but I suggest checking the result and possibly
    creating a backup just in case I missed something anyway.
    (sed -Ei.bak # ...)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]