CVSROOT:        /cvs
Module name:    src
Changes by:     schwa...@cvs.openbsd.org        2025/01/03 09:32:21

Modified files:
        usr.bin/mandoc : roff.c 
        regress/usr.bin/mandoc/roff/nr: predef.in predef.out_ascii 

Log message:
Rudimentatary implementation of the read-only number register \(.l,
which is supposed to contain the line length in basic units,
by setting it to a constant width of 78 characters,
no matter what the output width (-O width) is actually set to.

This occurs in man(7) code produced by DocBook XSL, for example
in DocBook XSL version 1.79.2, and hence it shows up in real-world
manual pages.  For example, tb@ reported finding it in git-reset(1)
last year.

Of course, setting this register to a constant value defeats the very
purpose the register is supposed to serve in the first place.
However, the most fundamental design principle of mandoc(1) is that
the parse tree is independent of the output mode.  That's not merely
a technical restriction but helps to make sure that the *content* of
documentation shown to the user does not depend on the output mode.
So allowing this register to depend on the "-O width" argument would
result in a layering violation that might, in the worst case,
cause a reliability issue.

Reply via email to