groff-commit
[Top][All Lists]
Advanced

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

[groff] 21/40: [man, mdoc]: Refactor (2/4).


From: G. Branden Robinson
Subject: [groff] 21/40: [man, mdoc]: Refactor (2/4).
Date: Mon, 12 Dec 2022 19:28:05 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 6819a0f4f193a04b00e26b356d95cefbfea61dfa
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Dec 11 08:30:22 2022 -0600

    [man, mdoc]: Refactor (2/4).
    
    [man, mdoc]: Refactor to separate page number management from header
    trap management.
    
    * tmac/an.tmac (an-start-new-document): Stop removing `an-header` trap.
    
      (TH): Clear the trap here even if not continuously rendering, and call
      `an-start-new-document`.
    
    * tmac/mdoc/doc-common (doc-start-new-document): Stop removing
      `doc-header` trap.
    
      (Dd): Clear the trap here even if not continuously rendering, and call
      `doc-start-new-document`.
---
 ChangeLog            | 15 +++++++++++++++
 tmac/an.tmac         | 14 ++++++++------
 tmac/mdoc/doc-common | 17 +++++++++--------
 3 files changed, 32 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 191b2512b..7297b6073 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2022-12-11  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [man, mdoc]: Refactor to separate page number management from
+       header trap management.
+
+       * tmac/an.tmac (an-start-new-document): Stop removing
+       `an-header` trap.
+       (TH): Clear the trap here even if not continuously rendering,
+       and call `an-start-new-document`.
+
+       * tmac/mdoc/doc-common (doc-start-new-document): Stop removing
+       `doc-header` trap.
+       (Dd): Clear the trap here even if not continuously rendering,
+       and call `doc-start-new-document`.
+
 2022-12-11  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * tmac/mdoc/doc-common: Refactor for better parallelism with our
diff --git a/tmac/an.tmac b/tmac/an.tmac
index df860cdbf..f3f44a682 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -176,11 +176,9 @@
 .  nr an-saved-prevailing-indent1 \\n[IN]
 ..
 .
-.\" Cause a page transition to a new man(7) document.  Clear the page
-.\" header trap so it is not sprung with stale information.  Update the
-.\" page number depending on the C (consecutive numbering) register.
+.\" Update the page number depending on the C (consecutive numbering)
+.\" register.
 .de an-start-new-document
-.  ch an-header
 .  ie \\n[C] .bp (\\n[%] + 1) \" argument NOT redundant before page 1
 .  el        .bp 1
 ..
@@ -215,8 +213,12 @@
 .  \" 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] \{\
-.    ie \\n[cR] .an-end
-.    el         .an-start-new-document
+.    if \\n[cR] .an-end
+.
+.    \" Clear the page header trap so it is not sprung with stale
+.    \" information.
+.    ch an-header
+.    an-start-new-document
 .    nr an-is-first-page-of-document 1
 .  \}
 .
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index b936735aa..eb32bec77 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -291,12 +291,14 @@
 .  \" must handle the end of a previous document.
 .  \"
 .  \" If also continuously rendering, cause a page transition to a new
-.  \" mdoc(7) document.  Clear the page header trap first so it is not
-.  \" sprung with stale information.  Update the page number depending
-.  \" on the C (consecutive numbering) register.
+.  \" mdoc(7) document.
 .  if !\n[doc-is-first-page-of-document] \{\
-.    ie \n[cR] .doc-end-macro
-.    el        .doc-start-new-document
+.    if \n[cR] .doc-end-macro
+.
+.    \" Clear the page header trap so it is not sprung with stale
+.    \" information.
+.    ch doc-header
+.    doc-start-new-document
 .    nr doc-is-first-page-of-document 1
 .  \}
 .
@@ -1148,12 +1150,11 @@
 .
 .
 .\" NS doc-start-new-document macro
-.\" NS   begin a new document
+.\" NS   Update the page number depending on the C (consecutive
+.\" NS   numbering) register.
 .
 .eo
 .de doc-start-new-document
-.  ch doc-header
-.
 .  ie \n[C] .bp (\n[%] + 1) \" argument NOT redundant before page 1
 .  el       .bp 1
 ..



reply via email to

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