bugGNU roff - Bugs: bug #64005, [ms] fix for Savannah #62688...

 
 

bug #64005: [ms] fix for Savannah #62688 suppresses page breaks between displays

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Wed 05 Apr 2023 11:02:47 PM UTC
   
 
Category:  Macro package ms Severity:  4 - Important
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
   

Jump to the original submission

Mon 10 Jul 2023 09:00:25 AM UTC, comment #6: 

Fixed and regression-tested.


commit 5808f3f4dd8f39341170597363a6aaf7acf921fd
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Apr 5 20:04:17 2023 -0500

    [ms]: Fix Savannah #64005.

    * tmac/s.tmac (@break-page, bp): Define alias for `bp` request and
      wrapper for `bp` to (if needed) temporarily disable no-space mode, so
      that a document's `bp` requests are honored even if no-space mode is
      on, as can happen after displays.  Fixes a regression from groff
      1.22.4 and historical ms implementations introduced by me on 6 July
      when resolving Savannah #62688.

    Fixes <https://savannah.gnu.org/bugs/?64005>.  Thanks to Michał
    Kruszewski for reporting the problem and Dave Kemper for identifying the
    cause.

    ANNOUNCE: Acknowledge Michał.

commit c30696d50f6a3a0c0a0597cde7933450e94805a6
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Apr 5 19:08:03 2023 -0500

    [ms]: Regression-test Savannah #64005.

    * tmac/tests/s_honor-page-break-after-display.sh: Do it.
    * tmac/tmac.am (tmac_TESTS): Run test.

    Test fails at this commit.


G. Branden Robinson <gbranden>
Group administrator
Fri 07 Apr 2023 04:37:05 PM UTC, comment #5: 


commit 72820ac3e1fd4c3421486b80c6b791503ae268a7
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Apr 5 20:04:17 2023 -0500

    [ms]: Fix Savannah #64005.

    * tmac/s.tmac (@break-page, bp): Define alias for `bp` request and
      wrapper for `bp` to (if needed) temporarily disable no-space mode, so
      that a document's `bp` requests are honored even if no-space mode is
      on, as can happen after displays.  Fixes a regression from groff
      1.22.4 and historical ms implementations introduced by me on 6 July
      when resolving Savannah #62688.

    Fixes <https://savannah.gnu.org/bugs/?64005>.  Thanks to Michał
    Kruszewski for reporting the problem and Dave Kemper for identifying the
    cause.

    ANNOUNCE: Acknowledge Michał.

commit 355a495a31b4560242067eeb8b9a46fe96bc3fa3
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Wed Apr 5 19:08:03 2023 -0500

    [ms]: Regression-test Savannah #64005.

    * tmac/tests/s_honor-page-break-after-display.sh: Do it.
    * tmac/tmac.am (tmac_TESTS): Run test.

    Test fails at this commit.


G. Branden Robinson <gbranden>
Group administrator
Thu 06 Apr 2023 03:14:57 AM UTC, comment #4: 

comment #3:

> Presumably the situation of interest is one where the document author
> invokes `ns`, interesting things happen, and then they invoke `bp`.


Right, or I was thinking more of a situation akin to the one that exposed this bug: where an ms user defines some local macro that includes an .ns, and somtimes calls that macro followed by a .bp.  Unless .de is also verboten to ms users.

Anyway, this was an off-the-cuff observation; as a non-ms user, I'm in no position to evaluate how valid the concern is, and what I glean from the rest of your message is "not very."  I trust that anyone with real objections will respond to the step-by-step proposal in the email thread.

Dave <barx>
Group Member
Thu 06 Apr 2023 02:30:20 AM UTC, comment #3: 

comment #2:

> original submission:
> > An only slightly less simple remedy might be to wrap the `bp`
> > request, forcing no-space on, invoking the "real" `bp`, and then
> > restoring no-space mode (if it was enabled).
>
> This would also cause .bp to start a new page even if the user has explicitly invoked .ns, correct?  That would presumably diverge from historical groff behavior, and possibly that of other roffs.


Yes.  But I'm not sure why you'd invoke `ns` and then immediately invoke `bp`.  There are easier ways to do nothing.

Presumably the situation of interest is one where the document author invokes `ns`, interesting things happen, and then they invoke `bp`.

I don't think `ns` and `rs` are what other macro packages (like me(7)) term "safe requests".

The only formatter requests that Lesk calls out in the Version 7 Unix ms manual are `bp`, `br`, `sp`, and `na`.  He doesn't take as strong a line as Allman did though, prefacing the foregoing with

> Among the useful commands from the basic formatting programs
> are the following.  They all work with both typesetter and
> computer terminal output:


He otherwise does not address the issue.  Given this, I'm tempted to regard only those 4 foregoing requests as explicitly "blessed" by the package.  Maybe I should add something to our doc/ms.ms about this.

The ms package uses `rs` and `ns` internally, and not lightly.  Even its earliest available form, from Version 6 Unix, has several occurrences.


$ grep -rw -C1 '[nr]s' HISTORY-MS/1975-05-v6/
HISTORY-MS/1975-05-v6/tmac.s-.de TX
HISTORY-MS/1975-05-v6/tmac.s:.rs
HISTORY-MS/1975-05-v6/tmac.s-.if t .sp .5i
--
HISTORY-MS/1975-05-v6/tmac.s-.ft R
HISTORY-MS/1975-05-v6/tmac.s:.rs
HISTORY-MS/1975-05-v6/tmac.s-.ce 1000
--
HISTORY-MS/1975-05-v6/tmac.s-.di WB
HISTORY-MS/1975-05-v6/tmac.s:.rs
HISTORY-MS/1975-05-v6/tmac.s-.ce 1
--
HISTORY-MS/1975-05-v6/tmac.s-.sp 6
HISTORY-MS/1975-05-v6/tmac.s:.ns
HISTORY-MS/1975-05-v6/tmac.s-.if \\n(TV .TX
--
HISTORY-MS/1975-05-v6/tmac.s-.ll \\n(LLu
HISTORY-MS/1975-05-v6/tmac.s:.rs
HISTORY-MS/1975-05-v6/tmac.s-.sp 6
HISTORY-MS/1975-05-v6/tmac.s:.ns
HISTORY-MS/1975-05-v6/tmac.s-.if \\n(TV .TX
--
HISTORY-MS/1975-05-v6/tmac.s-.if t .sp 0.5
HISTORY-MS/1975-05-v6/tmac.s:.ns
HISTORY-MS/1975-05-v6/tmac.s-..
--
HISTORY-MS/1975-05-v6/tmac.s-.nr MF 0
HISTORY-MS/1975-05-v6/tmac.s:.ns
HISTORY-MS/1975-05-v6/tmac.s-.os
--
HISTORY-MS/1975-05-v6/tmac.s-.nr RO \\n(L2*8/7
HISTORY-MS/1975-05-v6/tmac.s:.ns
HISTORY-MS/1975-05-v6/tmac.s-..
--
HISTORY-MS/1975-05-v6/tmac.s-.nr x 0 1
HISTORY-MS/1975-05-v6/tmac.s:.ns
HISTORY-MS/1975-05-v6/tmac.s-..


(As an aside, check that out, man--classical ms is name space clobberific!  It doesn't seem Lesk expected much use of `de`, `ds`, or `nr`, either.)

I want to say that if you use any other requests and your document breaks, you get to keep both pieces, but that is doubtless too harsh.  It's always okay to use `ab` and `tm`, for instance--I don't want to warn people off of tools that are useful for troubleshooting!

In any event, for the immediate issue, I think Lesk's endorsement of `bp` can decide the issue.  He clearly envisioned it being employed by document authors.  `ns` does not enjoy such an endorsement.

Given the choice between breaking documents' use of `bp` and `ns`, the answer seems clear.

What do you think?

G. Branden Robinson <gbranden>
Group administrator
Thu 06 Apr 2023 02:09:29 AM UTC, comment #2: 

original submission:

> An only slightly less simple remedy might be to wrap the `bp`
> request, forcing no-space on, invoking the "real" `bp`, and then
> restoring no-space mode (if it was enabled).


This would also cause .bp to start a new page even if the user has explicitly invoked .ns, correct?  That would presumably diverge from historical groff behavior, and possibly that of other roffs.

Dave <barx>
Group Member
Wed 05 Apr 2023 11:06:36 PM UTC, comment #1: 

Promoting to important severity since it regresses correct groff 1.22.4 behavior.

G. Branden Robinson <gbranden>
Group administrator
Wed 05 Apr 2023 11:02:47 PM UTC, original submission:  

The fix for bug #62688, to get more authentic-to-AT&T-ms spacing between displays, unfortunately also defeats user-requested page breaks between displays.

This was reported by Michał Kruszewski to the groff development list.

Here is some sample input.


.LP
Hello.
This is page \n%.
.DS
display goes here
.DE
.bp
.LP
This is page \n%.
.pl \n(nlu


All of groff 1.22.4 ms, DWB 3.3 ms, Heirloom Doctools ms, and Version 7 Unix ms honor the page break.  groff Git does not.

I had implemented the fix by simply kicking the formatter into no-space mode after displays and equations.  It was the simplest solution I could think of.

Unfortunately, it was too simple.

Come up with something better, and add a regression test.

An only slightly less simple remedy might be to wrap the `bp` request, forcing no-space on, invoking the "real" `bp`, and then restoring no-space mode (if it was enabled).

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

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by barx (Posted a comment)
  • -email is unavailable- added by gbranden (Submitted the item)
  • -email is unavailable- added by gbranden (original reporter)
  •  

    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 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-07-10 gbranden StatusReady for Merge Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.24.0
    2023-04-07 gbranden StatusIn Progress Ready for Merge
    2023-04-06 gbranden StatusConfirmed In Progress
    2023-04-05 gbranden Severity3 - Normal 4 - Important
    2023-04-05 gbranden Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code