[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 63/115: [mm]: Accept a second argument to `HU`.
From: |
G. Branden Robinson |
Subject: |
[groff] 63/115: [mm]: Accept a second argument to `HU`. |
Date: |
Thu, 1 Jun 2023 10:46:10 -0400 (EDT) |
gbranden pushed a commit to branch branden-2022-06-01
in repository groff.
commit 885bade0f17298e1102a030407d8fad073e67691
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu May 25 08:46:45 2023 -0500
[mm]: Accept a second argument to `HU`.
* contrib/mm/m.tmac (HU): Pass `H` all of our arguments. Also validate
quantity of arguments and throw error if called with none.
Fixes <https://savannah.gnu.org/bugs/?64204>.
---
NEWS | 4 ++++
contrib/mm/ChangeLog | 9 +++++++++
contrib/mm/groff_mm.7.man | 16 +++++++++++-----
contrib/mm/m.tmac | 3 ++-
4 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/NEWS b/NEWS
index 417e21763..6b97fb28f 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,10 @@ VERSION next
Macro packages
--------------
+o The m (mm) macro package's `HU` macro now supports a second argument
+ as a GNU extension. It corresponds to the optional third argument of
+ the `H` macro.
+
o The m (mm) macro package's `IND` macro (a GNU extension), now calls
`SK` only if no `TXIND` macro is defined, instead of performing this
action as part of the fallback when no `TYIND` macro is defined.
diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index a73a71fd7..de0f744f3 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,12 @@
+2023-05-25 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ Accept a second argument to `HU`.
+
+ * m.tmac (HU): Pass `H` all of our arguments. Also validate
+ quantity of arguments and throw error if called with none.
+
+ Fixes <https://savannah.gnu.org/bugs/?64204>.
+
2023-05-25 G. Branden Robinson <g.branden.robinson@gmail.com>
Slightly revise index output.
diff --git a/contrib/mm/groff_mm.7.man b/contrib/mm/groff_mm.7.man
index 49ee490bc..e09485ac9 100644
--- a/contrib/mm/groff_mm.7.man
+++ b/contrib/mm/groff_mm.7.man
@@ -2083,12 +2083,18 @@ An explicitly empty argument also indicates the default.
.
.
.TP
-.BI HU\~ heading-text
-Set an unnumbered section heading.
+.BI HU\~ title \~\c
+.RI [ suffix ]
+Set an unnumbered section heading with
+.I title
+and,
+as a GNU extension,
+an optional
+.I suffix.
.
-Except for a heading number,
-it is treated as a numbered heading of the level stored in
-.RB register\~ Hu ;
+The heading is treated as a numbered heading of the level stored in
+.RB register\~ Hu ,
+but no heading number is output;
.RB see\~ H .
.
.
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index e6cc4b234..ef74272f7 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -1033,7 +1033,8 @@ numeric; got '\\$1'
.ds \\$1 \\$[\\n[hd*sp-tmp]]
..
.de HU
-.H 0 "\\$1"
+.if \\n[.$]=0 .@error \\$0: expected 1 or 2 arguments, got \\n[.$]
+.H 0 \\$@
..
.\"-------------
.de H
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 63/115: [mm]: Accept a second argument to `HU`.,
G. Branden Robinson <=