[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 38/126: [ms]: Fix Savannah #64005.
From: |
G. Branden Robinson |
Subject: |
[groff] 38/126: [ms]: Fix Savannah #64005. |
Date: |
Wed, 5 Jul 2023 17:02:49 -0400 (EDT) |
gbranden pushed a commit to branch branden-2023-07-05
in repository groff.
commit 65f4d064f62ed0ba58d45a827ecc417be3e60f05
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ł.
---
ChangeLog | 15 +++++++++++++++
tmac/s.tmac | 29 ++++++++++++++++++++++-------
2 files changed, 37 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dce8534f6..80f746245 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 38/126: [ms]: Fix Savannah #64005.,
G. Branden Robinson <=