groff-commit
[Top][All Lists]
Advanced

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

[groff] 02/06: tmac/an-old.tmac: Slightly reorganize.


From: G. Branden Robinson
Subject: [groff] 02/06: tmac/an-old.tmac: Slightly reorganize.
Date: Sat, 15 May 2021 20:47:21 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 9cd0a96604bce1ce643f6f2b47e2fc85e830c03d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat May 15 15:57:13 2021 +1000

    tmac/an-old.tmac: Slightly reorganize.
    
    * tmac/an-old.tmac (initialization): Relocate load of devtag package; we
      don't need it before entering compatibility mode.
    
      Move assignment of format of an-page-letter register from a "loose
      declaration" amid macro definitions to within existence test of X
      register.
    
      (TH): Call DT in a less surprising place.
    
      (TH): Initialize all header/footer-related strings before calling
      header macros, even those not needed for the default header
      configuration.
    
      (an-ne): Rename register from "an-need", which is pretty confusing in
      context, to "an-amount", since (1) a (vertical) amount is what it is,
      and (2) it's only used within this macro.  Also due to factor (2),
      remove the register after using it.
---
 ChangeLog        | 12 ++++++++++++
 tmac/an-old.tmac | 29 ++++++++++++++---------------
 2 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2f4621b..72d0af6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,18 @@
        is even more guaranteed to exist; it is the macro name most
        characteristic of the man(7) language and the andoc.tmac
        superstructure relies on it.
+       (initialization): Relocate load of devtag package; we don't
+       need it before entering compatibility mode.  Move assignment of
+       format of an-page-letter register from a "loose declaration"
+       amid macro definitions to within existence test of X register.
+       (TH): Call DT in a less surprising place.
+       (TH): Initialize all header/footer-related strings before
+       calling header macros, even those not needed for the default
+       header configuration.
+       (an-ne): Rename register from "an-need", which is pretty
+       confusing in context, to "an-amount", since (1) a (vertical)
+       amount is what it is, and (2) it's only used within this macro.
+       Also due to factor (2), remove the register after using it.
 
 2021-05-15  G. Branden Robinson <g.branden.robinson@gmail.com>
 
diff --git a/tmac/an-old.tmac b/tmac/an-old.tmac
index c2a2b8f..e2296a3 100644
--- a/tmac/an-old.tmac
+++ b/tmac/an-old.tmac
@@ -28,8 +28,6 @@
 .
 .do if d TH .nx
 .
-.do mso devtag.tmac
-.
 .do nr *groff_an-old_tmac_C \n[.cp]
 .cp 0
 .
@@ -51,6 +49,7 @@
 .    tm \*[an-old]:\\n[.F]:\\n[.c]: style: \\$*
 ..
 .
+.mso devtag.tmac
 .nr need_eo_h 0
 .nr need_col2 0
 .
@@ -65,11 +64,12 @@
 .\" increased to the necessary amount (this is needed for tables).
 .de an-ne
 .  ie \\n[.$] \
-.    nr an-need (v;\\$*)
+.    nr an-amount (v;\\$*)
 .  el \
-.    nr an-need 1v
-.  if (\\n[an-need] >= \\n[.t]) \
-.    pl +(\\n[an-need]u - \\n[.t]u + 1v)
+.    nr an-amount 1v
+.  if (\\n[an-amount] >= \\n[.t]) \
+.    pl +(\\n[an-amount]u - \\n[.t]u + 1v)
+.  rr an-amount
 ..
 .
 .\" This .bp replacement adjusts the page length to the current position
@@ -123,8 +123,6 @@
 .    DEVTAG-EO-TL
 .  \}
 .
-.  DT
-.
 .  nr PS    10z \" default point size
 .  nr PS-SS 10z
 .  nr PS-SH 10.95z
@@ -157,6 +155,7 @@
 .  ll \\n[LL]u
 .  ss 12
 .
+.  DT
 .  PD
 .  an-set-margin
 .
@@ -182,6 +181,10 @@
 .  el                  .ds an-extra3 \" empty
 .  \}\}\}\}\}\}\}\}\}\}
 .
+.  ds an-extra1 "\\$3\"
+.  ie (\\n[.$] > 3)    .ds an-extra2 "\\$4\"
+.  el                  .ds an-extra2 \" empty
+.
 .  ie \\n[cR] \
 .    an-header
 .  el \{\
@@ -194,10 +197,6 @@
 .      el        .bp 1
 .    \}
 .  \}
-.
-.  ds an-extra1 "\\$3\"
-.  ie (\\n[.$] > 3)    .ds an-extra2 "\\$4\"
-.  el                  .ds an-extra2 \" empty
 ..
 .
 .\" BSD compatibility macros: .AT and .UC
@@ -278,8 +277,6 @@
 '  bp
 ..
 .
-.af an-page-letter a
-.
 .de1 an-p-footer
 .  ev an-1
 .  ps \\n[PS]u
@@ -816,11 +813,13 @@
 .\"
 .\" Unlike most of these parameters, we do not set a default for X; only
 .\" the macro an-p-footer uses it.
-.if r X \
+.if r X \{\
+.  af an-page-letter a
 .  if \n[an-html] \{\
 .     tm \*[an-old]: ignoring page letter suffixing in HTML output
 .     rr X
 .  \}
+.\}
 .
 .\" adjustment mode
 .if !d AD \



reply via email to

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