groff-commit
[Top][All Lists]
Advanced

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

[groff] 16/30: [man]: Simplify logic populating center header.


From: G. Branden Robinson
Subject: [groff] 16/30: [man]: Simplify logic populating center header.
Date: Sat, 12 Oct 2024 12:07:53 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit db9862af21b1c6f564c6afa55117d3aa461d1c9e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Oct 11 11:46:19 2024 -0500

    [man]: Simplify logic populating center header.
    
    * tmac/an.tmac (TH): Simplify population of center header.
---
 ChangeLog    |  4 ++++
 tmac/an.tmac | 17 +++++------------
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f54e8b59d..897cd8682 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2024-10-11  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * tmac/an.tmac (TH): Simplify logic populating center header.
+
 2024-10-11  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/an.tmac: Rename internal strings and registers.
diff --git a/tmac/an.tmac b/tmac/an.tmac
index bcd243416..a231523ab 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -325,18 +325,11 @@
 .  ds an*section "\\$2\"
 .  ie (\\n[.$] > 4) .ds an-extra3 "\\$5\"
 .  el \{\
-.    \" Simulate switch/case in roff.
-.          ie '\\$2'1' .ds an-extra3 \\*[an*section1]\"
-.    el \{.ie '\\$2'2' .ds an-extra3 \\*[an*section2]\"
-.    el \{.ie '\\$2'3' .ds an-extra3 \\*[an*section3]\"
-.    el \{.ie '\\$2'4' .ds an-extra3 \\*[an*section4]\"
-.    el \{.ie '\\$2'5' .ds an-extra3 \\*[an*section5]\"
-.    el \{.ie '\\$2'6' .ds an-extra3 \\*[an*section6]\"
-.    el \{.ie '\\$2'7' .ds an-extra3 \\*[an*section7]\"
-.    el \{.ie '\\$2'8' .ds an-extra3 \\*[an*section8]\"
-.    el \{.ie '\\$2'9' .ds an-extra3 \\*[an*section9]\"
-.    el                .ds an-extra3 \" empty
-.    \}\}\}\}\}\}\}\}
+.    ds an-extra3 \" empty
+.    if \B'\\$2' \{\
+.      if ((\\$2 > 0) & (\\$2 < 10)) \
+.        ds an-extra3 \\*[an*section\\$2]
+.    \}
 .  \}
 .
 .  ds an-extra1 "\\$3\"



reply via email to

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