aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2023-08-19 02:53:49 -0500
committerG. Branden Robinson <g.branden.robinson@gmail.com>2023-08-19 02:59:26 -0500
commit3b615aa0fac692a8a24442a14726e71594c5f805 (patch)
tree6603e1b22319a2f309acbae99abfdb91660a525a
parentb44fad19eeab0ab4d123cb16aaa481c399535b48 (diff)
[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").
-rw-r--r--contrib/mm/ChangeLog13
-rw-r--r--contrib/mm/m.tmac3
2 files changed, 16 insertions, 0 deletions
diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 2d0cefd..7bc9852 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,5 +1,18 @@
2023-08-19 G. Branden Robinson <g.branden.robinson@gmail.com>
+ * 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 <g.branden.robinson@gmail.com>
+
Regression-test Savannah #64336.
* tests/flush-long-displays-at-end-of-input.sh: Do it.
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index f1aac3f..531ad13 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