[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 20/40: tmac/mdoc/doc-common: Refactor (1/4).
From: |
G. Branden Robinson |
Subject: |
[groff] 20/40: tmac/mdoc/doc-common: Refactor (1/4). |
Date: |
Mon, 12 Dec 2022 19:28:05 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 9c647ce8e9e0c5065b1bdc21bfe95a67d7fe63e5
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sun Dec 11 07:18:31 2022 -0600
tmac/mdoc/doc-common: Refactor (1/4).
* tmac/mdoc/doc-common: Refactor for better parallelism with our man(7)
implementation and to prepare for a synchronized change to both.
(Dd): Move open-coded (inlined) operations from here...
(doc-start-new-document): ...to this new macro.
(doc-end-macro): Drop unnecessary register assignment. `Dd` takes
care of it if there is a subsequent mdoc(7) document.
---
ChangeLog | 10 ++++++++++
tmac/mdoc/doc-common | 21 ++++++++++++++-------
2 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 12ab3793d..191b2512b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2022-12-11 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ * tmac/mdoc/doc-common: Refactor for better parallelism with our
+ man(7) implementation and to prepare for a synchronized change
+ to both.
+ (Dd): Move open-coded (inlined) operations from here...
+ (doc-start-new-document): ...to this new macro.
+ (doc-end-macro): Drop unnecessary register assignment. `Dd`
+ takes care of it if there is a subsequent mdoc(7) document.
+
2022-12-07 G. Branden Robinson <g.branden.robinson@gmail.com>
[tbl]: Fix off-by-one error in generated diagnostic message.
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index db2a28871..b936735aa 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -296,12 +296,7 @@
. \" on the C (consecutive numbering) register.
. if !\n[doc-is-first-page-of-document] \{\
. ie \n[cR] .doc-end-macro
-. el \{\
-. ch doc-header
-.
-. ie \n[C] .bp (\n[%] + 1) \" argument NOT redundant before page 1
-. el .bp 1
-. \}
+. el .doc-start-new-document
. nr doc-is-first-page-of-document 1
. \}
.
@@ -1140,7 +1135,6 @@
. \}
. ch doc-header
. bp
-. nr doc-is-first-page-of-document 1
.
. \" Reset strings to reduce info leaks from one man page to the next.
. ds doc-date-string UNDATED\"
@@ -1153,6 +1147,19 @@
.ec
.
.
+.\" NS doc-start-new-document macro
+.\" NS begin a new document
+.
+.eo
+.de doc-start-new-document
+. ch doc-header
+.
+. ie \n[C] .bp (\n[%] + 1) \" argument NOT redundant before page 1
+. el .bp 1
+..
+.ec
+.
+.
.\" NS doc-paragraph macro
.\" NS insert a paragraph
.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 20/40: tmac/mdoc/doc-common: Refactor (1/4).,
G. Branden Robinson <=