[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 01/01: Repair .AT and .UC in the groff_man(7) macros.
From: |
Ingo Schwarze |
Subject: |
[groff] 01/01: Repair .AT and .UC in the groff_man(7) macros. |
Date: |
Thu, 16 Jan 2020 08:21:47 -0500 (EST) |
schwarze pushed a commit to branch master
in repository groff.
commit a628605e2b26106a6e1e5afbf8cc390283099fa8
Author: Ingo Schwarze <address@hidden>
AuthorDate: Thu Jan 16 13:59:48 2020 +0100
Repair .AT and .UC in the groff_man(7) macros.
* tmac/an-old.tmac:
Setting user-defined strings in a macro that will later be called
indirectly from page location traps is excessively complicated.
Besides, the implementation doesn't work: when the trap is finally
sprung, the defaults from the an-init macro clobber what the author
specified with .AT or .UC.
Instead, all that is needed is setting the strings for the header
before triggering the page break, such that they appear right
away, while setting the strings for the footer after the page
break, such that they don't appear on the previous page.
This bug was found by Jonathan Gray <address@hidden>
while he looked at 4.xBSD manual pages.
Thanks to gbranden@ for finding a bug in first version of my patch
and for agreeing with the idea, see: https://savannah.gnu.org/bugs/?57416
---
ChangeLog | 18 ++++++++++++++++++
tmac/an-old.tmac | 46 +++++++++++++++++++++-------------------------
2 files changed, 39 insertions(+), 25 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 742997e..027d7ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2020-01-16 Ingo Schwarze <address@hidden>
+
+ Repair .AT and .UC in the groff_man(7) macros.
+
+ * tmac/an-old.tmac:
+ Setting user-defined strings in a macro that will later be called
+ indirectly from page location traps is excessively complicated.
+ Besides, the implementation doesn't work: when the trap is finally
+ sprung, the defaults from the an-init macro clobber what the author
+ specified with .AT or .UC.
+ Instead, all that is needed is setting the strings for the header
+ before triggering the page break, such that they appear right
+ away, while setting the strings for the footer after the page
+ break, such that they don't appear on the previous page.
+
+ This bug was found by Jonathan Gray <address@hidden>
+ while he looked at 4.xBSD manual pages.
+
2020-01-16 G. Branden Robinson <address@hidden>
* tmac/groff_man.7.man: Fix errors in footer description.
diff --git a/tmac/an-old.tmac b/tmac/an-old.tmac
index 50bac10..b789ade 100644
--- a/tmac/an-old.tmac
+++ b/tmac/an-old.tmac
@@ -146,30 +146,6 @@
. DEVTAG-EO-TL
. \}
.
-. de an-init \" This approach gets multiple man pages right.
-. ds an-title "\\$1\"
-. if \\\\n[CT] .stringup an-title
-. ds an-section "\\$2\"
-. ds an-extra1 "\\$3\"
-. ie (\\n[.$] > 3) .ds an-extra2 "\\$4\"
-. el .ds an-extra2 \"Sun Release 4.0
-.
-. ie (\\n[.$] > 4) .ds an-extra3 "\\$5\"
-. el \{ .ie '\\$2'1' .ds an-extra3 General Commands Manual
-. el \{ .ie '\\$2'2' .ds an-extra3 System Calls Manual
-. el \{ .ie '\\$2'3' .ds an-extra3 Library Functions Manual
-. el \{ .ie '\\$2'3p' .ds an-extra3 Perl Programmers Reference Guide
-. el \{ .ie '\\$2'4' .ds an-extra3 Kernel Interfaces Manual
-. el \{ .ie '\\$2'5' .ds an-extra3 File Formats Manual
-. el \{ .ie '\\$2'6' .ds an-extra3 Games Manual
-. el \{ .ie '\\$2'7' .ds an-extra3 Miscellaneous Information Manual
-. el \{ .ie '\\$2'8' .ds an-extra3 System Manager's Manual
-. el \{ .ie '\\$2'9' .ds an-extra3 Kernel Developer's Manual
-. el .ds an-extra3
-. \}\}\}\}\}\}\}\}\}\}
-. ds an-init
-\\..
-.
. DT
.
. nr PS 10z \" default point size
@@ -215,6 +191,23 @@
. nr an-break-flag 0
. nr an-div? 0
.
+. ds an-title "\\$1\"
+. if \\n[CT] .stringup an-title
+. ds an-section "\\$2\"
+. ie (\\n[.$] > 4) .ds an-extra3 "\\$5\"
+. el \{ .ie '\\$2'1' .ds an-extra3 General Commands Manual
+. el \{ .ie '\\$2'2' .ds an-extra3 System Calls Manual
+. el \{ .ie '\\$2'3' .ds an-extra3 Library Functions Manual
+. el \{ .ie '\\$2'3p' .ds an-extra3 Perl Programmers Reference Guide
+. el \{ .ie '\\$2'4' .ds an-extra3 Kernel Interfaces Manual
+. el \{ .ie '\\$2'5' .ds an-extra3 File Formats Manual
+. el \{ .ie '\\$2'6' .ds an-extra3 Games Manual
+. el \{ .ie '\\$2'7' .ds an-extra3 Miscellaneous Information Manual
+. el \{ .ie '\\$2'8' .ds an-extra3 System Manager's Manual
+. el \{ .ie '\\$2'9' .ds an-extra3 Kernel Developer's Manual
+. el .ds an-extra3
+. \}\}\}\}\}\}\}\}\}\}
+.
. ie \\n[cR] \
. an-header
. el \{\
@@ -227,6 +220,10 @@
. el .bp 1
. \}
. \}
+.
+. ds an-extra1 "\\$3\"
+. ie (\\n[.$] > 3) .ds an-extra2 "\\$4\"
+. el .ds an-extra2 \"Sun Release 4.0
..
.
.\" BSD compatibility macros: .AT and .UC
@@ -277,7 +274,6 @@
..
.
.de1 an-header
-. an-init
. if \\n[cR] \{\
. ie \\n[an-first] \
. nr an-first 0
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 01/01: Repair .AT and .UC in the groff_man(7) macros.,
Ingo Schwarze <=