gbranden pushed a commit to branch master
in repository groff.
commit 739fde61ef3fb752a7fd1a0b1a8f3f593f2c2371
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Apr 24 19:38:21 2026 -0500
[man]: Fix Savannah #68279.
* tmac/an.tmac (SH, SS, TP): Throw warning if macro called while an
input trap is pending (for example, `.TP` followed immediately by
`.SH`). This input is not specified or countenanced by any man(7)
documentation I know of, and produces unpredictable output across
implementations. (Given the foregoing example, Plan 9 troff truncates
the input at that point.) Seen in the wild in fvwm-config(1).
Fixes <https://savannah.gnu.org/bugs/?68279>.
---
ChangeLog | 12 ++++++++++++
tmac/an.tmac | 3 +++
2 files changed, 15 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index a2906cdd7..c1ae28662 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-04-24 G. Branden Robinson <[email protected]>
+
+ * tmac/an.tmac (SH, SS, TP): Throw warning if macro called while
+ an input trap is pending (for example, `.TP` followed
+ immediately by `.SH`). This input is not specified or
+ countenanced by any man(7) documentation I know of, and produces
+ unpredictable output across implementations. (Given the
+ foregoing example, Plan 9 troff truncates the input at that
+ point.) Seen in the wild in fvwm-config(1).
+
+ Fixes <https://savannah.gnu.org/bugs/?68279>.
+
2026-04-24 G. Branden Robinson <[email protected]>
* src/roff/troff/env.cpp (environment::newline): Reset contents
diff --git a/tmac/an.tmac b/tmac/an.tmac
index c6f3a1fc5..59e8fd5d3 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -770,6 +770,7 @@ contains unsupported escape sequence
.\" Set arguments (or next input line producing written or drawn output
.\" if none) as a section heading.
.de1 SH
+. if \\n[.it] .an-warn cannot call .\\$0 while an input trap is pending
. an*reset-section-parameters
. an*break-paragraph
. fi
@@ -798,6 +799,7 @@ contains unsupported escape sequence
.\" Set arguments (or next input line producing written or drawn output
.\" if none) as a subsection heading.
.de1 SS
+. if \\n[.it] .an-warn cannot call .\\$0 while an input trap is pending
. an*reset-section-parameters
. an*break-paragraph
. fi
@@ -885,6 +887,7 @@ contains unsupported escape sequence
.\" producing written or drawn output.
.\" .TP [indent]
.de1 TP
+. if \\n[.it] .an-warn cannot call .\\$0 while an input trap is pending
. an*break-paragraph
. if \\n[.$] .nr an-prevailing-indent (n;\\$1)
. if '\\n[.z]'an*paragraph-tag' \{\
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit