1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
|
From cb39b179f14d868f679bbb0ac7a7d42b780cf0a4 Mon Sep 17 00:00:00 2001
From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Date: Sun, 4 May 2025 12:11:15 +0100
Subject: [mdoc]: Fix Savannah #65480 (`Nm` reset).
* tmac/mdoc/doc-common (doc-reset-titles): New macro pulls several
string assignment operations to here...
(doc-end-macro): ...from here, because they're needed more generally.
(Dd): Call the new macro unconditionally.
Fixes <https://savannah.gnu.org/bugs/?65480>. Problem introduced by me
in the 1.23.0 development cycle; I didn't bother to bisect it down to an
individual commit because I know I churned parts of the macro package
pretty vigorously to get batch rendering of mixed man(7) and mdoc(7)
documents working correctly. (And as we can see, I didn't _quite_
succeed.)
Origin: upstream, https://git.savannah.gnu.org/cgit/groff.git/commit/?id=7a6fb7f81834365b39da76e4877d742056c66d4a
Bug: https://savannah.gnu.org/bugs/?65480
Bug-Debian: https://bugs.debian.org/1104609
Last-Update: 2025-05-04
Patch-Name: mdoc-nm-reset.patch
---
tmac/mdoc/doc-common | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index 769b3700d..3ca1c1044 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -306,6 +306,8 @@
. \}
. if \n[C] .rr P
.
+. doc-reset-titles
+.
. if !\n[.$] \
. tm mdoc warning: .Dd directive expects an argument (#\n[.c])
. if \n[.$] \{\
@@ -1112,6 +1114,22 @@
.ec
.
.
+.\" NS doc-reset-titles macro
+.\" NS prepare for a new mdoc(7) document
+.
+.eo
+.de doc-reset-titles
+. \" Reset strings to reduce info leaks from one man page to the next.
+. ds doc-date-string UNDATED\"
+. ds doc-page-topic UNTITLED\"
+. ds doc-volume LOCAL\"
+. ds doc-section \" empty
+. ds doc-operating-system \" empty
+. ds doc-topic-name \" empty
+..
+.ec
+.
+.
.\" NS doc-end-macro macro
.\" NS finish output
.\" NS
@@ -1148,14 +1166,6 @@
. \}
. ch doc-header
. doc-break-page-with-new-number
-.
-. \" Reset strings to reduce info leaks from one man page to the next.
-. ds doc-date-string UNDATED\"
-. ds doc-page-topic UNTITLED\"
-. ds doc-volume LOCAL\"
-. ds doc-section \" empty
-. ds doc-operating-system \" empty
-. ds doc-topic-name \" empty
..
.ec
.
|