groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 35/115: [ms]: Fix Savannah #64005.


From: G. Branden Robinson
Subject: [groff] 35/115: [ms]: Fix Savannah #64005.
Date: Thu, 1 Jun 2023 10:46:05 -0400 (EDT)

gbranden pushed a commit to branch branden-2022-06-01
in repository groff.

commit 1130e9bd2b7e28fc286afe5921758fa820761ad6
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: 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ł.
---
 ANNOUNCE    |  1 +
 ChangeLog   | 15 +++++++++++++++
 tmac/s.tmac | 29 ++++++++++++++++++++++-------
 3 files changed, 38 insertions(+), 7 deletions(-)

diff --git a/ANNOUNCE b/ANNOUNCE
index 8fe16cc05..be09f54e2 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -213,6 +213,7 @@ John Gardner
 KUBO Koichi
 Keith Marshall
 Ken Mandelberg
+Michał Kruszewski
 Nikita Ivanov
 Oliver Corff
 Olle Lögdahl
diff --git a/ChangeLog b/ChangeLog
index 5513719da..54423a6fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2023-04-05  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [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.
+
 2023-04-05  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [ms]: Regression-test Savannah #64005.
diff --git a/tmac/s.tmac b/tmac/s.tmac
index bdf36b885..236594f89 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -95,6 +95,21 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .      @divert \\$*
 ..
 .
+.\" Wrap the `bp` request so that we disregard the enablement of
+.\" no-space mode, which we enter after displays and equations to
+.\" prevent multiple sources of vertical space (like the DD and PD
+.\" registers) from incorrectly accumulating.  Thus, if the user
+.\" requests a page break, we honor it.  See Savannah #62688 & #64005.
+.als @break-page bp
+.de bp
+.      nr @saved-no-space-mode \\n[.ns]
+.      rs
+.      ie \\n[.br] '@break-page \\$1
+.      el          .@break-page \\$1
+.      if \\n[@saved-no-space-mode] .ns
+.      rr @saved-no-space-mode
+..
+.
 .de @init
 .if !rPO .nr PO \\n(.o
 .\" a non-empty environment
@@ -373,8 +388,8 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .AE
 ..
 .de cov*break-page
-.ie \\n[cov*rp-no-renumber] .bp
-.el .bp 1
+.ie \\n[cov*rp-no-renumber] .@break-page
+.el .@break-page 1
 ..
 .de cov*print
 .als cov*print @nop
@@ -559,7 +574,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .      \" flush out any floating keeps
 .      while \\n[kp@tail]>\\n[kp@head] \{\
 .              rs
-.              bp
+.              @break-page
 .      \}
 .\}
 .ie !\\n(.$ \{\
@@ -650,7 +665,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .      \" Switching environments ensures that we don't get an unnecessary
 .      \" blank line at the top of the page.
 .      ev ne
-'      bp
+'      @break-page
 .      ev
 .\}
 .el \{\
@@ -665,7 +680,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .                      rm pg*next-format
 .              \}
 .      \}
-'      bp
+'      @break-page
 .\}
 ..
 .\" pg@begin number format
@@ -698,9 +713,9 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 .\" overflow left, or floating keeps.
 .while \\n[kp@tail]>\\n[kp@head]:\\n[pg@fn-flag] \{\
 .      rs
-.      bp
+.      @break-page
 .\}
-.bp
+.@break-page
 ..
 .nr pg@text-ended 0
 .de pg@end-text



reply via email to

[Prev in Thread] Current Thread [Next in Thread]