gbranden pushed a commit to branch master
in repository groff.
commit 3b615aa0fac692a8a24442a14726e71594c5f805
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Aug 19 02:53:49 2023 -0500
[mm]: Fix Savannah #64336 (lost floats at end).
* contrib/mm/m.tmac: Flush displays at end of input even if they cause
page breaks. Inspection of source code suggests that the problem
dates back to the introduction of the package in groff 1.04,
1991-11-17. Our mm stumbled into a pitfall of AT&T compatibility.
Our Texinfo manual (which did not exist yet in 1991) says: "For
historical reasons (compatibility with AT&T 'troff'), the end-of-input
macro exits as soon as it causes a page break if no partially
collected line remains. ..."
Fixes <https://savannah.gnu.org/bugs/?64336>.
Maybe a better design would have been to require end-of-input traps
(those planted with the `em` request) to explicitly exit with `ex` (or
`ab`) when they finish their business. And maybe we should make that
change in a future groff release (but keep the old behavior in
"compatibility mode").
---
contrib/mm/ChangeLog | 13 +++++++++++++
contrib/mm/m.tmac | 3 +++
2 files changed, 16 insertions(+)
diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 2d0cefd49..7bc9852fd 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,16 @@
+2023-08-19 G. Branden Robinson <[email protected]>
+
+ * m.tmac: Flush displays at end of input even if they cause page
+ breaks. Inspection of source code suggests that the problem
+ dates back to the introduction of the package in groff 1.04,
+ 1991-11-17. Our mm stumbled into a pitfall of AT&T
+ compatibility. Our Texinfo manual (which did not exist yet in
+ 1991) says: "For historical reasons (compatibility with AT&T
+ 'troff'), the end-of-input macro exits as soon as it causes a
+ page break if no partially collected line remains. ..."
+
+ Fixes <https://savannah.gnu.org/bugs/?64336>.
+
2023-08-19 G. Branden Robinson <[email protected]>
Regression-test Savannah #64336.
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index f1aac3f64..531ad13d4 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -1243,6 +1243,7 @@ numeric; got '\\$1'
.nr pg*cols-per-page 1
.nr pg*cur-po \n[@po]
.nr pg*head-mark 0
+.nr pg*at-end-of-input 0
.\"
.nr pg*ps \n[@ps]
.nr pg*vs \n[@vs]
@@ -1296,6 +1297,7 @@ numeric; got '\\$1'
.de pg@next-page
.\".debug next-page
.br
+.if \\n[pg*at-end-of-input] \c
.ne 999i \" activate trap
.\" .pg@footer
..
@@ -1544,6 +1546,7 @@ numeric; got '\\$1'
.\"-------------------------
.\" print out all pending text
.de pg@end-of-text
+.nr pg*at-end-of-input 1
.if \\n[D]>2 .tm ---------- End of text processing ----------------
.df@eot-print
.ref@eot-print
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit