bug-ncurses
[Top][All Lists]
Advanced

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

[PATCH 01/39] man/MKterminfo.sh: Revert change that disrupts adjustment.


From: G. Branden Robinson
Subject: [PATCH 01/39] man/MKterminfo.sh: Revert change that disrupts adjustment.
Date: Sat, 1 Mar 2025 06:18:49 -0600

Revert change submitted by Bjarni Ingi Gislason in Debian #1096164,
where he wrote:

"Adjustment (and hyphenation) is a waste of processor's time and should
not be default practice."

These are matters of taste and opinion; Unix defaults have varied over
time,[1] and groff permits both to be configured in the site's
"man.local" file (hyphenation since 1.19 [2003] and alignment/adjustment
since 1.23 [2023]).

The `ad` request does not behave the way most *roff users seem to think
it does.  (Nor does the `hy` request.)

`.hy` means "enable automatic hyphenation using mode 1"--_not_ "whatever
mode was in use prior to `nh` being invoked".  Traditional man(7)
packages set the hyphenation mode to 14, so calling `.hy` without an
argument will produce incorrect or undesired hyphenation afterward.
(Research Tenth Edition Unix's "tmac.an" file introduced a macro `HY` to
compensate for this behavior.)

`.ad`'s meaning is sufficiently complex that I dedicated an email to
explaining and proposing new groff extensions to escape its surprises,
which unfortunately will largely not be available to man pages in the
foreseeable future due to portability concerns.[2]  One will note that I
wrote that message in reply to Bjarni, and he responded, but the lessons
of `ad`'s bizarre semantics after `na` seem not to have sunken in.  He
furthermore noted, correctly, that all *roffs seem to operate in this
bizarre manner,[3] but perhaps has since forgotten it.

Bjarni may not have tested his changes, or he would have noticed that
adjustment sometimes sprang back to life after the ends of tables.

If we format the terminfo(5) page in its 20250216 and 20250222 revisions
with the `AD` string set to "l" (left-alignment, adjustment disabled),
we see the following changes to the rendered text.

--- terminfo.5.AD=l.20250216.txt        2025-02-24 03:29:05.008026925 -0600
+++ terminfo.5.AD=l.20250222.txt        2025-02-24 03:30:24.603898099 -0600
@@ -18,7 +18,7 @@
        have, by specifying how to perform screen operations, and by specifying
        padding requirements and initialization sequences.

-       This document describes ncurses version 6.5 (patch 20250216).
+       This document describes ncurses version 6.5 (patch 20250222).

    terminfo Entry Syntax
        Entries in terminfo consist of a sequence of fields:
@@ -287,8 +287,8 @@
        no_color_video             ncv       NC  video attributes that cannot
                                                 be used with colors

-       The following numeric capabilities are present in the SVr4.0 term
-       structure, but are not yet documented in the man page.  They came in
+       The  following  numeric  capabilities  are  present  in the SVr4.0 term
+       structure, but are not yet documented in the man page.   They  came  in
        with SVr4’s printer support.

                                       Code
[...]

There are others.

To respect user configuration preferences, man pages _should not use_
requests that affect hyphenation or adjustment.  (Exception: inside a
tbl(1) text block, they cannot do lasting damage to the page.)

Revert the change, restoring the technique of invoking `.ad l` inside
every text block, which Bjarni criticized as repetitious, but have the
virtue of rendering the page as desired.

[1] The original Seventh Edition Unix man(7) package (1979) disabled
    adjustment in nroff mode only, but not hyphenation.  Unix System III
    (1980) disabled both in nroff mode.  Tenth Edition Research Unix
    (1989) followed suit.  By contrast, Unix System V Release 4 (1989)
    _stopped_ disabling both.  BSD appears to have stuck with Version
    7's configuration throughout its lifetime, at least from 3BSD
    (1980) to 4.4BSD-Lite (1994).

    I don't have complete records of vendor Unix, but SunOS 2.0 (1985)
    commented out disablement of adjustment in nroff mode, and retained
    that configuration through SunOS 3.5 (1988) and 4.1.4 (1994).

    See:
    https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/lib/tmac/tmac.an
    https://minnie.tuhs.org/cgi-bin/utree.pl?file=SysIII/usr/lib/macros/an
    https://minnie.tuhs.org/cgi-bin/utree.pl?file=V10/cmd/mk/export/tmac.an
    
https://github.com/ryanwoodsmall/oldsysv/blob/master/sysvr4/svr4/ucbcmd/troff/troff.d/tmac.d/an
    https://minnie.tuhs.org/cgi-bin/utree.pl?file=3BSD/usr/lib/tmac/tmac.an.new
    
https://minnie.tuhs.org/cgi-bin/utree.pl?file=4.4BSD/usr/old/lib/tmac/tmac.an

    I don't have public hyperlinks for SunOS sources I can share; sorry.
    Archivists might want to try Bitsavers.

[2] https://lists.gnu.org/archive/html/groff/2024-06/msg00053.html
[3] https://lists.gnu.org/archive/html/groff/2024-06/msg00056.html
---
 man/MKterminfo.sh | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/man/MKterminfo.sh b/man/MKterminfo.sh
index 6ea455d54..37dcb554a 100755
--- a/man/MKterminfo.sh
+++ b/man/MKterminfo.sh
@@ -76,9 +76,6 @@ trap 'code=$?; rm -f $sorted $temp $unsorted; exit $code' 
EXIT HUP INT QUIT TERM
 rm -f $sorted $temp $unsorted
 
 cat $caps | sed -n "\
-/^#%.TS/i.na
-/^#%.TE/a\
-.ad
 /%%-STOP-HERE-%%/q
 /^#%center/s, expand,,
 /^#%lw25/s, lw6 , lw7 ,
@@ -87,6 +84,7 @@ cat $caps | sed -n "\
 s/[    ][      ]*/     /g
 s/$/T}/
 s/     [A-Z0-9_()\-][A-Z0-9_()\-]*     [0-9\-][0-9\-]* 
[Y\-][B\-][C\-][G\-][EK\-]\**   /       T{\\
+.ad l\
 /
 s/     bool    /       /p
 s/     num     /       /p
-- 
2.30.2

Attachment: signature.asc
Description: PGP signature


reply via email to

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