groff-commit
[Top][All Lists]
Advanced

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

[groff] 23/30: [mm]: Refactor `Np`/`H` interaction.


From: G. Branden Robinson
Subject: [groff] 23/30: [mm]: Refactor `Np`/`H` interaction.
Date: Sat, 12 Oct 2024 12:07:55 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit c236b4f149b53813768266ab6479b3a03a552b85
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Oct 12 03:30:45 2024 -0500

    [mm]: Refactor `Np`/`H` interaction.
    
    * contrib/mm/m.tmac (initialization): Refactor.  Drop never-interpolated
      register `par*num-counter`.
    
      (par@reset-num): This macro was called in only one place, so delete
      it...
    
      (H): ...and open-code its logic at its lone call site.  Format complex
      numeric expressions in conditionals using the dense and
      AT&T-compatible manner of the rest of the package, omitting
      parentheses and spaces where possible.
---
 contrib/mm/ChangeLog | 11 +++++++++++
 contrib/mm/m.tmac    |  9 +--------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index fe12bd6ea..64637b1c4 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,14 @@
+2024-10-12  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * m.tmac (initialization): Refactor.  Drop never-interpolated
+       register `par*num-counter`.
+       (par@reset-num): This macro was called in only one place, so
+       delete it...
+       (H): ...and open-code its logic at its lone call site.  Format
+       complex numeric expressions in conditionals using the dense and
+       AT&T-compatible manner of the rest of the package, omitting
+       parentheses and spaces where possible.
+
 2024-10-12  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tests/Np-register-works.sh: Add unit test.
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 087682a66..49ba9aa5c 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -483,13 +483,6 @@ http://savannah.gnu.org/bugs/?group=groff.
 .af par*number 01
 .nr par*number2 0 1
 .af par*number2 01
-.nr par*num-count 0 1
-.af par*num-count 01
-.\"    reset numbered paragraphs, arg1 = headerlevel
-.de par@reset-num
-.if \\$1<3 .nr par*num-count 0
-.if (\\$1=1)&(\\n[Np]=1) .nr par*number 0
-..
 .\"------------
 .\" paragraph
 .de P
@@ -1162,7 +1155,7 @@ numeric; got '\\$1'
 .ie \\n[hd*level]<=\\n[Hps] .SP (u;\\n[Hps2])
 .el                         .SP (u;\\n[Hps1])
 .\"
-.par@reset-num \\n[hd*level]\"                 reset numbered paragraph
+.if \\$1=1&\\n[Np] .nr par*number 0
 .\" start diversion to measure size of header
 .di hd*div
 \\*[hd*mark]\\$2\\$3\\*[hd*suf-space]



reply via email to

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