bugGNU roff - Bugs: bug #64336, [mm] loses long floating display

 
 

bug #64336: [mm] loses long floating display

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Thu 22 Jun 2023 08:18:42 AM UTC
   
 
Category:  Macro package mm Severity:  3 - Normal
Item Group:  Incorrect behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.24.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 22 Aug 2023 06:26:44 PM UTC, comment #2: 

Pushed a few days ago.


commit 3b615aa0fac692a8a24442a14726e71594c5f805
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   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").


G. Branden Robinson <gbranden>
Group administrator
Thu 17 Aug 2023 01:52:20 PM UTC, comment #1: 

This appears to do the trick.


diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index f1aac3f64..13be6e24d 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -1296,6 +1296,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 +1545,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


G. Branden Robinson <gbranden>
Group administrator
Thu 22 Jun 2023 08:18:42 AM UTC, original submission:  

We have a 3-way incompatibility between DWB, Heirloom, and groff mm.

Input:


$ cat DF-no-flush-bug.mm
.P
The modern conservative is engaged in one of man's oldest exercises in
moral philosophy;
that is,
the search for a superior moral justification for selfishness.
.br
\(em J.\& K.\& Galbraith
.\" This display is exactly long enough to float past the next paragraph
.\" on DWB 3.3 nroff/mm.  Heirloom Doctools loses the display entirely,
.\" no matter what its length.
.DF
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
This is my display.
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.\" With 3 more lines, groff 1.22.4 mm loses it, too.
.if \n(.g \{\
46
47
48
.\}
.DE
.P
Goodbye,
cruel world!


Output:


$ DWBHOME=. ./bin/nroff -mm DF-no-flush-bug.mm | cat -s

                                  - 1 -

       The modern conservative is engaged in one of man's oldest
       exercises in moral philosophy; that is, the search for a
       superior moral justification for selfishness.
       - J. K. Galbraith

       Goodbye, cruel world!

                                  - 2 -

       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
       This is my display.
       31
       32
       33
       34
       35
       36
       37
       38
       39
       40
       41
       42
       43
       44
       45

[cd heirloom]
$ ./bin/nroff -mm DF-no-flush-bug.mm | cat -s

                                  - 1 -

       The modern conservative is engaged in one of man's oldest
       exercises in moral philosophy; that is, the search for a
       superior moral justification for selfishness.
       -- J. K. Galbraith

       Goodbye, cruel world!

$ nroff -mm DF-no-flush-bug.mm | cat -s

                                   ‐ 1 ‐

       The  modern  conservative  is engaged in one of man’s oldest
       exercises in moral philosophy; that is,  the  search  for  a
       superior moral justification for selfishness.
       — J. K. Galbraith

       Goodbye, cruel world!


G. Branden Robinson <gbranden>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-08-22 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.24.0
    2023-08-17 gbranden StatusConfirmed In Progress
        Assigned toNone gbranden
    2023-08-10 gbranden Dependencies- bugs #64316 is dependent

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code