[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 25/40: [man, mdoc]: Refactor (4/4).
From: |
G. Branden Robinson |
Subject: |
[groff] 25/40: [man, mdoc]: Refactor (4/4). |
Date: |
Mon, 12 Dec 2022 19:28:06 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 98f1a1bb339ffb252edcfb0049d511afe22a4e9a
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Dec 11 12:39:26 2022 -0600
[man, mdoc]: Refactor (4/4).
[man, mdoc]: Refactor. Rename a Boolean register to more clearly
communicate its purpose. This also reverses its sense.
* tmac/an.tmac (TH): Rename `an-is-first-page-of-document` to
`an*need-titles-reset`. Drop redundant store. Reverse sense of test.
(initialization): Initialize it to zero.
* tmac/mdoc/doc-common (Dd): Rename `doc-is-first-page-of-document` to
`doc-need-titles-reset`. Drop redundant store. Reverse sense of
test.
(initialization): Initialize it to zero.
---
ChangeLog | 15 +++++++++++++++
tmac/an.tmac | 10 ++++++----
tmac/mdoc/doc-common | 17 ++++++++---------
3 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index cc20c0e24..88b69f70c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2022-12-11 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [man, mdoc]: Refactor. Rename a Boolean register to more
+ clearly communicate its purpose. This also reverses its sense.
+
+ * tmac/an.tmac (TH): Rename `an-is-first-page-of-document` to
+ `an*need-titles-reset`. Drop redundant store. Reverse sense of
+ test.
+ (initialization): Initialize it to zero.
+
+ * tmac/mdoc/doc-common (Dd): Rename
+ `doc-is-first-page-of-document` to `doc-need-titles-reset`.
+ Drop redundant store. Reverse sense of test.
+ (initialization): Initialize it to zero.
+
2022-12-11 G. Branden Robinson <g.branden.robinson@gmail.com>
[tests]: Add future regression test for header/footer
diff --git a/tmac/an.tmac b/tmac/an.tmac
index d562b3bf9..783b6692d 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -212,14 +212,13 @@
.
. \" If batch processing (rendering multiple) man page documents, we
. \" must handle the end of a previous document.
-. if !\\n[an-is-first-page-of-document] \{\
+. if \\n[an*need-titles-reset] \{\
. if \\n[cR] .an-end
.
. \" Clear the page header trap so it is not sprung with stale
. \" information.
. ch an-header
. an*break-page-with-new-number
-. nr an-is-first-page-of-document 1
. \}
.
. nr an-TH-was-called 1 \" an-end can make certain assumptions.
@@ -354,7 +353,7 @@
. \}
. \}
.
-. nr an-is-first-page-of-document 0
+. nr an*need-titles-reset 1
..
.
.\" Support legacy AT&T and BSD Unix man pages.
@@ -1247,7 +1246,10 @@ contains unsupported escape sequence
.nr an-devtag-needs-end-of-heading 0
.nr an-devtag-needs-second-column 0
.
-.nr an-is-first-page-of-document 1
+.\" Track whether the strings that set header and footer text need to be
+.\" reconfigured. This happens when batch-rendering and starting a new
+.\" page.
+.nr an*need-titles-reset 0
.
.nr an*is-output-html 0
.if '\*[.T]'html' .nr an*is-output-html 1
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index c757b387c..9890eab75 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -292,14 +292,13 @@
. \"
. \" If also continuously rendering, cause a page transition to a new
. \" mdoc(7) document.
-. if !\n[doc-is-first-page-of-document] \{\
+. if \n[doc-need-titles-reset] \{\
. if \n[cR] .doc-end-macro
.
. \" Clear the page header trap so it is not sprung with stale
. \" information.
. ch doc-header
. doc-break-page-with-new-number
-. nr doc-is-first-page-of-document 1
. \}
.
. if !\n[.$] \
@@ -973,7 +972,7 @@
. pdfbookmark 1 "\*[doc-page-topic](\*[doc-section])"
.
. doc-header
-. nr doc-is-first-page-of-document 0
+. nr doc-need-titles-reset 1
..
.ec
.
@@ -1105,7 +1104,7 @@
.\" NS finish output
.\" NS
.\" NS modifies:
-.\" NS doc-is-first-page-of-document
+.\" NS doc-need-titles-reset
.
.eo
.de doc-end-macro
@@ -1266,13 +1265,13 @@
.nr doc-in-authors-section 0
.
.
-.\" NS doc-is-first-page-of-document global register (bool)
-.\" NS whether the drawing position is at the top of the first page of
-.\" NS a document
+.\" NS doc-need-titles-reset global register (bool)
+.\" NS whether the strings that set header and footer text need to be
+.\" NS reconfigured
.\" NS
-.\" NS This is necessarily true when the macro package is loaded.
+.\" NS This happens when batch-rendering and starting a new page.
.
-.nr doc-is-first-page-of-document 1
+.nr doc-need-titles-reset 0
.
.
.\" NS doc-first-parameter macro
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 25/40: [man, mdoc]: Refactor (4/4).,
G. Branden Robinson <=