groff-commit
[Top][All Lists]
Advanced

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

[groff] 10/30: [mm]: Recognize an `RPX` hook macro.


From: G. Branden Robinson
Subject: [groff] 10/30: [mm]: Recognize an `RPX` hook macro.
Date: Thu, 10 Oct 2024 20:18:11 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 9df225958389b4b377d40a12276fda32e6fdd36d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Oct 9 09:07:27 2024 -0500

    [mm]: Recognize an `RPX` hook macro.
    
    * contrib/mm/m.tmac (RP): Move `SP 2` call (spacing before reference
      list caption) from here...
    
      (ref@print-refs): ...to here.  Bracket the formatting of the caption
      in a conditional; if an `RPX` macro is defined, call that instead.
    
    * contrib/mm/groff_mm.7.man (Macros) <RPX>: Document facility.
    
    * NEWS: Add item.
---
 NEWS                      |  4 ++++
 contrib/mm/ChangeLog      |  9 +++++++++
 contrib/mm/groff_mm.7.man | 15 +++++++++++++++
 contrib/mm/m.tmac         | 11 +++++++----
 4 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index ae3afe8a3..ef3f60076 100644
--- a/NEWS
+++ b/NEWS
@@ -433,6 +433,10 @@ Macro packages
    `AFX`, which if defined is called by `AF` in lieu of the latter's
    normal operation.  Applications include customization of letterhead.
 
+*  The m (mm) macro package now supports a user-definable hook macro
+   `RPX`, which if defined is called by `RP` to format the reference
+   list caption string `Rp` instead of the default formatting.
+
 *  The m (mm) macro package's `LI` macro now interprets its second
    argument as a Boolean value indicating whether a space should
    separate the list item mark from its prefix (the first argument).
diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index c28c460b5..58944b3ce 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 (RP): Move `SP 2` call (spacing before reference list
+       caption) from here...
+       (ref@print-refs): ...to here.  Bracket the formatting of the
+       caption in a conditional; if an `RPX` macro is defined, call
+       that instead.
+       * groff_mm.7.man (Macros) <RPX>: Document facility.
+
 2024-10-09  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * m.tmac (RP): Validate macro arguments.
diff --git a/contrib/mm/groff_mm.7.man b/contrib/mm/groff_mm.7.man
index 62cef24db..542452552 100644
--- a/contrib/mm/groff_mm.7.man
+++ b/contrib/mm/groff_mm.7.man
@@ -3433,6 +3433,21 @@ The string
 contains the reference list caption.
 .
 .
+.TP
+.B RPX
+This user-definable hook macro assumes responsibility for formatting
+the heading of the reference page produced when the document calls
+.B RP .
+.
+If not defined
+(the default),
+the reference list caption in the string
+.B Rp
+is set after two vees of space,
+centered in italics,
+and followed by another vee of space.
+.
+.
 .br
 .ne 5v
 .TP
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index 6aa315a48..4503e8e7e 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -3123,7 +3123,6 @@ argument '\\$1' as '1'
 argument: '\\$2'
 .\}
 .if \\n[ref*i]<2 .SK
-.SP 2
 .ref@print-refs
 .if (\\n[ref*i]=0):(\\n[ref*i]=2) .SK
 .rr ref*reset-counter
@@ -3148,9 +3147,13 @@ argument: '\\$2'
 .\" prints the references
 .de ref@print-refs
 .toc@save 1 "" "\\*[Rp]" \\n[%]
-.ce
-\f2\\*[Rp]\fP
-.sp
+.ie d RPX .RPX
+.el \{\
+.      SP 2
+.      ce
+.      nop \f2\\*[Rp]\fP
+.      sp
+.\}
 .nr ref*ll \\n[.l]
 .misc@ev-keep ref*ev
 .ll \\n[ref*ll]u



reply via email to

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