gbranden pushed a commit to branch master
in repository groff.
commit be9afbd8b5ab3131061a6b6d42c9b60b16546e0d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Oct 20 01:09:26 2025 -0500
[ms]: Support floating keeps on cover page.
(Traditionally, a cover page is exactly that--a page, singular, and
therefore support for floating keeps should be unnecessary. But letting
a content reviewer scold a document author for letting a keep float to a
second "cover" page seems less bad than the macro package throwing
difficult-to-comprehend diagnostic messages.)
* tmac/s.tmac: Initialize new Boolean-valued global register
`@is-initialized` as false on startup. Initialize the `k` and `nf`
environments at startup, and copy their properties from environment
`0`.
(@init): Stop initializing `nf` environment here. Make
`@is-initialized` true.
(KF): Call `par@reset-env` and `par@reset` only if the package is
initialized. If it isn't, these macros are not yet defined.
---
ChangeLog | 18 ++++++++++++++++++
tmac/s.tmac | 23 ++++++++++++++++++-----
2 files changed, 36 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a97a61d6e..cc9dec956 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2025-10-20 G. Branden Robinson <[email protected]>
+
+ [ms]: Support floating keeps on cover page. (Traditionally, a
+ cover page is exactly that--a page, singular, and therefore
+ support for floating keeps should be unnecessary. But letting a
+ content reviewer scold a document author for letting a keep
+ float to a second "cover" page seems less bad than the macro
+ package throwing difficult-to-comprehend diagnostic messages.)
+
+ * tmac/s.tmac: Initialize new Boolean-valued global register
+ `@is-initialized` as false on startup. Initialize the `k` and
+ `nf` environments at startup, and copy their properties from
+ environment `0`.
+ (@init): Stop initializing `nf` environment here. Make
+ `@is-initialized` true.
+ (KF): Call `par@reset-env` and `par@reset` only if the package
+ is initialized. If it isn't, these macros are not yet defined.
+
2025-10-20 G. Branden Robinson <[email protected]>
* tmac/tests/s_start-document-with-keep-quietly.sh: Test more
diff --git a/tmac/s.tmac b/tmac/s.tmac
index 0867773fd..645fc703d 100644
--- a/tmac/s.tmac
+++ b/tmac/s.tmac
@@ -41,6 +41,8 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.\" Define a string for use in diagnostic messages.
.ds @s s.tmac\"
.
+.nr @is-initialized 0
+.
.de @diag
. ds *file \" empty
. ds *line \" empty
@@ -114,15 +116,24 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
. rr @saved-no-space-mode
..
.
+.\" Initialize environments `k` and `nf` immediately so that keeps can
+.\" be used on a cover page.
+.ev k
+.evc 0
+.ev
+.
+.ev nf
+.evc 0
+'nf
+.ev
+.
.de @init
.if !rPO .nr PO \\n(.o
.\" a non-empty environment
.ev ne
\c
.ev
-.ev nf
-'nf
-.ev
+.nr @is-initialized 1
..
.ds REFERENCES References
.ds ABSTRACT ABSTRACT
@@ -930,8 +941,10 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>.
.if !'\\n(.z'' .@error-recover .KF while diversion open
.di kp@fdiv
.ev k
-.par@reset-env
-.par@reset
+.if \\n[@is-initialized] \{\
+. par@reset-env
+. par@reset
+.\}
..
.de KE
.nr kp*did-closure-succeed 0
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit