groff-commit
[Top][All Lists]
Advanced

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

[groff] 04/04: tmac/an-old.tmac: Drop .ll hack for LL register.


From: G. Branden Robinson
Subject: [groff] 04/04: tmac/an-old.tmac: Drop .ll hack for LL register.
Date: Tue, 15 Sep 2020 16:50:19 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 7770e10fa4d5b903b6923f466154c806c44de35a
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Aug 22 15:47:58 2020 +1000

    tmac/an-old.tmac: Drop .ll hack for LL register.
    
    Drop the .ll hack for setting the line length on nroff devices.
    
    Once upon a time, the only way to get man pages to render on a terminal
    at any width other than the nroff default of 65n was to put an .ll
    request into the page--a mortal sin against portability--or your man(1)
    program could sneak such a request into nroff's input stream.
    
    Also, long ago, John Eaton of UT Austin wrote a man(1) program.  In a
    few years this implementation branched into two lines of development,
    which I'll call man-db man (Wilford/Polacco/Watson) and another,
    Brouwer/Lucifredi man, which as of this writing saw its last release in
    2011 (1.6g).
    
    The man and mdoc macros of groff 1.18 (July 2002) introduced an LL
    register to configure the line length, respecting an -rLL command-line
    option.  The source change was made by Werner Lemberg on 3 May 2002 and
    Colin Watson updated man-db man(1)--on the same day!--to synthesize the
    option when calling groff.
    
    Later, in August 2005, Keith Marshall, a user of vesion 1.5m of
    Brouwer/Lucifredi man(1), which did not set the LL register, suggested
    that the existing .ll setting (technically, the value of \n[.l], the
    only way the result of an .ll request could be introspected) be honored
    in the absence of the LL register.  However, it is impossible to
    distinguish a user-supplied ".ll 65n" request from nroff's default
    setting, which was in that case overridden to the modern default of 78n.
    
    And so, in what is now git commit
    f9d5df4aebd3d834b4084ffefa52a115e00dce38 (1 September 2005), it was
    done.
    
    This led to (1) surprising behavior for users accustomed to old methods
    and desirous of the nroff default and (2) lengthy apologia in groff
    source code comments and the groff_man(7) man page.
    
    Ironically, Brouwer/Lucifredi man(1) had already added support for the
    LL register by the time of its 1.6 release two months earlier (20 June
    2005).  (Curiously, it did so similarly to the old .ll hack, by
    injecting an '.nr LL' request into groff's input stream, rather than
    using the -r command-line option.)  Moreover, Marshall and the groff
    list were already aware of this, but the change was accepted anyway
    because version 1.6 was "too new"!  (Distributions are slow sometimes,
    true...)
    
    Let us survey the field in 2020.  man-db man(1) has supported the LL
    register for eighteen years, and Brouwer/Lucifredi man(1) for fifteen.
    Heirloom Doctools's man macros set the line length to 78n on nroff
    devices unconditionally.  mandoc(1) similarly also always formats for 78
    columns on terminals.  groff's mdoc(7) macros grew support for LL in
    parallel with man(7) in 2002 and never added the \n[.l] introspection at
    all.
    
    There no longer seems to be any reason to preserve this hack.
    
    * tmac/an-old.tmac (initialization): Drop complex setup of LL register.
      (TH): Relocate line length reset; no behavior change.
    
      (after .mso man.local): Initialize LL only if the user hasn't; use
      device default in troff mode, and 78n in nroff mode.
    
    * tmac/groff_man.7.man.in (Options) <-rLL>: Stop documenting .ll hack.
    
    Fixes <https://savannah.gnu.org/bugs/index.php?58992>.
---
 ChangeLog               | 72 +++++++++++++++++++++++++++++++++++++++++++++++++
 NEWS                    |  7 +++++
 tmac/an-old.tmac        | 40 +++++++++++----------------
 tmac/groff_man.7.man.in | 45 -------------------------------
 4 files changed, 94 insertions(+), 70 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b25bb01..5b5d8a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,77 @@
 2020-09-16  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       tmac/an-old.tmac: Drop .ll hack for LL register.
+
+       Drop the .ll hack for setting the line length on nroff devices.
+
+       Once upon a time, the only way to get man pages to render on a
+       terminal at any width other than the nroff default of 65n was to
+       put an .ll request into the page--a mortal sin against
+       portability--or your man(1) program could sneak such a request
+       into nroff's input stream.
+
+       Also, long ago, John Eaton of UT Austin wrote a man(1) program.
+       In a few years this implementation branched into two lines of
+       development, which I'll call man-db man (Wilford/Polacco/Watson)
+       and another, Brouwer/Lucifredi man, which as of this writing saw
+       its last release in 2011 (1.6g).
+
+       The man and mdoc macros of groff 1.18 (July 2002) introduced an
+       LL register to configure the line length, respecting an -rLL
+       command-line option.  The source change was made by Werner
+       Lemberg on 3 May 2002 and Colin Watson updated man-db man(1)--on
+       the same day!--to synthesize the option when calling groff.
+
+       Later, in August 2005, Keith Marshall, a user of vesion 1.5m of
+       Brouwer/Lucifredi man(1), which did not set the LL register,
+       suggested that the existing .ll setting (technically, the value
+       of \n[.l], the only way the result of an .ll request could be
+       introspected) be honored in the absence of the LL register.
+       However, it is impossible to distinguish a user-supplied ".ll
+       65n" request from nroff's default setting, which was in that
+       case overridden to the modern default of 78n.
+
+       And so, in what is now git commit
+       f9d5df4aebd3d834b4084ffefa52a115e00dce38 (1 September 2005), it
+       was done.
+
+       This led to (1) surprising behavior for users accustomed to old
+       methods and desirous of the nroff default and (2) lengthy
+       apologia in groff source code comments and the groff_man(7) man
+       page.
+
+       Ironically, Brouwer/Lucifredi man(1) had already added support
+       for the LL register by the time of its 1.6 release two months
+       earlier (20 June 2005).  (Curiously, it did so similarly to the
+       old .ll hack, by injecting an '.nr LL' request into groff's
+       input stream, rather than using the -r command-line option.)
+       Moreover, Marshall and the groff list were already aware of
+       this, but the change was accepted anyway because version 1.6
+       was "too new"!  (Distributions are slow sometimes, true...)
+
+       Let us survey the field in 2020.  man-db man(1) has supported
+       the LL register for eighteen years, and Brouwer/Lucifredi man(1)
+       for fifteen.  Heirloom Doctools's man macros set the line length
+       to 78n on nroff devices unconditionally.  mandoc(1) similarly
+       also always formats for 78 columns on terminals.  groff's
+       mdoc(7) macros grew support for LL in parallel with man(7) in
+       2002 and never added the \n[.l] introspection at all.
+
+       There no longer seems to be any reason to preserve this hack.
+
+       * tmac/an-old.tmac (initialization): Drop complex setup of LL
+       register.
+       (TH): Relocate line length reset; no behavior change.
+       (after .mso man.local): Initialize LL only if the user hasn't;
+       use device default in troff mode, and 78n in nroff mode.
+
+       * tmac/groff_man.7.man.in (Options) <-rLL>: Stop documenting .ll
+       hack.
+
+       Fixes <https://savannah.gnu.org/bugs/index.php?58992>.
+
+2020-09-16  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * tmac/tests/an-old_LL_init_sanely.sh: Add test.
        * tmac/tmac.am (tmac_TESTS): Run test.
 
diff --git a/NEWS b/NEWS
index 7ab198b..69380be 100644
--- a/NEWS
+++ b/NEWS
@@ -104,6 +104,13 @@ o The an (man) macro package supports new CS and CT number 
registers to
   implementations) a way to view the rendered page elements in full
   capitals if desired.
 
+o The an (man) macro package no longer honors an .ll request to set the
+  line length in nroff devices prior to processing a man page.  This was
+  deprecated 18 years ago, and all known man program and macro package
+  implementations either have set/respected an LL register since 2005 or
+  earlier (man-db man and Brouwer/Lucifredi man), or simply use a
+  non-configurable line length of 78n (mandoc, Heirloom Doctools).
+
 o The groff_man(7) man page documenting the groff implementation of the
   man macro package has been split into two pages.  The original page
   remains as a terser reference for experienced users.  A new page,
diff --git a/tmac/an-old.tmac b/tmac/an-old.tmac
index 69e70e2..e191fbd 100644
--- a/tmac/an-old.tmac
+++ b/tmac/an-old.tmac
@@ -54,30 +54,6 @@
 .nr need_eo_h 0
 .nr need_col2 0
 .
-.\" set up the line length...
-.\" giving precedence to any prior assignment to the \n[LL] register.
-.if !r LL \{\
-.
-.  \" but if that isn't predefined...
-.  \" then try to respect any prior '.ll' request.
-.  nr LL \n[.l]
-.
-.  \" For troff, this is sufficient to give us a default line length of
-.  \" 6.5i, but for nroff, we prefer a default of 78n to nroff's default
-.  \" 65n.  This has the unfortunate side effect that we will override a
-.  \" user's '.ll 65n' request, with our preferred 78n default; we can't
-.  \" possibly know that the 65n came from a '.ll' request, and MUST
-.  \" assume that it was set by nroff, as its built-in default!  If the
-.  \" user wants to force this setting, then he MUST use the '-rLL=65n'
-.  \" option, or an equivalent '.nr LL 65n' request.
-.  if n \
-.    if (\n[LL] = 65n) \
-.      nr LL 78n
-.\}
-.
-.if !r LT \
-.  nr LT \n[LL]
-.
 .nr FT (-.5i)
 .
 .nr an-first 1
@@ -158,11 +134,11 @@
 .
 .  ps \\n[PS]u
 .  vs \\n[VS]u
-.  ll \\n[LL]u
 .
 .  \" Restore parameters that a previous man page might have messed up.
 .  ad \\*[AD]
 .  hy \\n[HY]
+.  ll \\n[LL]u
 .  ss 12
 .
 .\" We must select an integer indentation value for nroff;
@@ -705,6 +681,20 @@
 .    nr S 12
 .\}
 .
+.\" line length
+.if !r LL \{\
+.  \" If in troff mode, respect device default.
+.  ie t \
+.    nr LL \n[.l]
+.  \" Otherwise, override nroff mode default of 65n.
+.  el \
+.    nr LL 78n
+.\}
+.
+.\" title (header, footer) length
+.if !r LT \
+.  nr LT \n[LL]u
+.
 .\" adjustment mode
 .if !d AD \
 .  ds AD b\"
diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 90e0c78..a871b69 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -3010,51 +3010,6 @@ Set line length;
 the default is 78n for terminal devices
 and 6.5i for typesetter devices.
 .
-If this option is not given,
-.\" Don't bold the .ll request in this discussion; it's not a major
-.\" topic of _this_ page as it would be in groff(7).  Also, we don't
-.\" want to encourage people to mess with this old kludge by drawing
-.\" attention to it.
-the line length is set to respect any value set by a prior \(lq.ll\(rq
-request
-(which
-.I must
-be in effect when the
-.B .TH
-macro is invoked),
-if this differs from the built-in default for the formatter.
-.
-.
-.IP
-Note that the use of an \(lq.ll\(rq request to initialize the line
-length is supported for backward compatibility with some versions of
-the
-.I man
-program;
-direct initialization of the
-.B LL
-register should
-.I always
-be preferred to the use of such a request.
-.
-In particular,
-note that an \(lq.ll\~65n\(rq request does
-.I not
-preserve the default
-.I nroff
-line length
-(the
-.I man
-default initialization to 78n prevails),
-whereas the
-.B \-rLL=65n
-option,
-or an equivalent \(lq.nr\~LL\~65n\(rq request preceding the use of the
-.B .TH
-macro,
-.I does
-set a line length of 65n.
-.
 .
 .TP
 .BI \-rLT= title-length



reply via email to

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