[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 23/49: [ms]: Slightly simplify new `XN` macro feature.
From: |
G. Branden Robinson |
Subject: |
[groff] 23/49: [ms]: Slightly simplify new `XN` macro feature. |
Date: |
Sun, 25 Sep 2022 17:02:57 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 57ccb455e793cd43ae44da74417aaa28864049fb
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Sep 21 12:04:45 2022 -0500
[ms]: Slightly simplify new `XN` macro feature.
...to align it more closely with Berkeley TOC macro behavior; don't
prepend the table of contents entry with the section number (`\*[SN]`).
If desired, a document can define `XN-REPLACEMENT`. This does not
regress "pdfmark.ms" because it uses an alternative, older
implementation of these features from "spdf.tmac".
* tmac/s.tmac (XH-UPDATE-TOC): Update comments.
(XN-REPLACEMENT): Do it.
---
ChangeLog | 12 ++++++++++++
tmac/s.tmac | 7 +++----
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index afb2e5419..e6c418c88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2022-09-21 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [ms]: Slightly simplify new `XN` macro feature to align it more
+ closely with Berkeley TOC macro behavior; don't prepend the
+ table of contents entry with the section number (`\*[SN]`). If
+ desired, a document can define `XN-REPLACEMENT`. This does not
+ regress "pdfmark.ms" because it uses an alternative, older
+ implementation of these features from "spdf.tmac".
+
+ * tmac/s.tmac (XH-UPDATE-TOC): Update comments.
+ (XN-REPLACEMENT): Do it.
+
2022-09-20 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/pdf.tmac (pdf*href-I): Call `pdf:error` macro by its
diff --git a/tmac/s.tmac b/tmac/s.tmac
index bdc5fd0bf..aa7b347b6 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -1789,12 +1789,11 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.de XN-INIT
..
.de XH-UPDATE-TOC
-.\" .XH-UPDATE-TOC <outline-level> [<section-number>] <text>
-.\" (<section-number> present only when called by XN)
+.\" .XH-UPDATE-TOC <outline-level> <text>
.XS
.in (\\$1u - 1u * 2n)
.shift
-\&\\$*\" capture <section-number> (if present) and <text>
+\&\\$*
.XE
..
.\" Rudimentary integration hook, to be called (nominally)
@@ -1823,7 +1822,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.rm \\$0
.de XN-REPLACEMENT
.XN-INIT
-.XH-UPDATE-TOC \\n[nh*hl] \\*[SN] \\$@
+.XH-UPDATE-TOC \\n[nh*hl] \\$@
\&\\$*
..
.de toc*end-entry
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 23/49: [ms]: Slightly simplify new `XN` macro feature.,
G. Branden Robinson <=