groff-commit
[Top][All Lists]
Advanced

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

[groff] 12/30: [mm]: Refactor in observance of DRY principle.


From: G. Branden Robinson
Subject: [groff] 12/30: [mm]: Refactor in observance of DRY principle.
Date: Thu, 10 Oct 2024 20:18:11 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 8ecff34171a9f29f1113a0b29a02f0e236384a4c
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Oct 9 11:44:52 2024 -0500

    [mm]: Refactor in observance of DRY principle.
    
    * m.tmac: Refactor.  Define new internal strings `ref*(` and `ref*)` to
      bracket reference marks.  Define `Rf` string in terms of these.
    
      (RS): If given an argument, use the new strings in the named string's
      contents instead of repeating the literal content now stored in the
      new strings.
---
 contrib/mm/ChangeLog | 9 +++++++++
 contrib/mm/m.tmac    | 6 ++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 09e83e8c7..e7cb91cb1 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,12 @@
+2024-10-09  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * m.tmac: Refactor.  Define new internal strings `ref*(` and
+       `ref*)` to bracket reference marks.  Define `Rf` string in terms
+       of these.
+       (RS): If given an argument, use the new strings in the named
+       string's contents instead of repeating the literal content now
+       stored in the new strings.
+
 2024-10-09  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * mm/0.MT: Stop putting a blank line between author names in the
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 4503e8e7e..b955c758b 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -3062,12 +3062,14 @@ exceeds depth of nested lists (\\n[li*lvl])
 .aln :R ref*nr
 .nr ref*nr-width 5n
 .nr ref*flag 0         \" for end-of-text
-.ds Rf \v'-.4m'\s-3[\\n+[ref*nr]]\s0\v'.4m'
+.ds ref*( \v'-.4m'\s-3[
+.ds ref*) ]\s0\v'.4m'
+.ds Rf \*[ref*(]\\n+[ref*nr]\*[ref*)]
 .\"
 .\" start reference
 .\"------------
 .de RS
-.if !''\\$1' .ds \\$1 \v'-.4m'\s-3[\\n[ref*nr]]\s0\v'.4m'
+.if !''\\$1' .ds \\$1 \*[ref*(]\\n[ref*nr]\*[ref*)]
 .nr ref*flag 1
 .am ref*mac
 .ref@start-print \\n[ref*nr].



reply via email to

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