groff-commit
[Top][All Lists]
Advanced

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

[groff] 27/51: [mdoc]: Refactor.


From: G. Branden Robinson
Subject: [groff] 27/51: [mdoc]: Refactor.
Date: Sun, 11 Sep 2022 08:15:53 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 813c90abc1285957c47c7595a4d93e4d1ac4ab87
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Sep 6 23:53:33 2022 -0500

    [mdoc]: Refactor.
    
    There is no difference in `doc-header-string` and `doc-setup-header`
    between the files "doc-ditroff" and "doc-nroff", so define them only
    once, in "doc-common".
    
    * tmac/mdoc/doc-common:
    * tmac/mdoc/doc-ditroff:
    * tmac/mdoc/doc-nroff: Do it.
---
 ChangeLog             | 11 +++++++++++
 tmac/mdoc/doc-common  | 33 +++++++++++++++++++++++++++++++++
 tmac/mdoc/doc-ditroff | 33 ---------------------------------
 tmac/mdoc/doc-nroff   | 33 ---------------------------------
 4 files changed, 44 insertions(+), 66 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a0a122372..e491039fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-09-06  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [mdoc]: Refactor.  There is no difference in
+       `doc-header-string` and `doc-setup-header` between the files
+       "doc-ditroff" and "doc-nroff", so define them only once, in
+       "doc-common".
+
+       * tmac/mdoc/doc-common:
+       * tmac/mdoc/doc-ditroff:
+       * tmac/mdoc/doc-nroff: Do it.
+
 2022-09-06  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [mdoc]: Align footer management more closely with man(7).
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index c92dd3288..148cd54c6 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -212,6 +212,39 @@
 .ds doc-section \" empty
 .
 .
+.\" NS doc-header-string global string
+.\" NS   the final string used for the manual page header
+.
+.ds doc-header-string
+.
+.
+.\" NS doc-setup-header macro
+.\" NS   install and initialize header and footer support
+.\" NS
+.\" NS modifies:
+.\" NS   doc-header-string
+.\"
+.\" TODO: Support man(7)'s `FT` register.
+.
+.eo
+.de doc-setup-header
+.  ds doc-header-string "\*[doc-document-title]
+.  if !"\*[doc-section]"" \
+.    as doc-header-string \|(\*[doc-section])
+.
+.  br
+.
+.  if !\n[cR] \{\
+.    wh 0 doc-header
+.    wh -1.0i doc-break-body-text
+.    wh -.5i doc-footer
+.  \}
+.
+.  e@ doc-end-macro
+..
+.ec
+.
+.
 .\" NS Dt user macro (not parsed, not callable)
 .\" NS   document title
 .\" NS
diff --git a/tmac/mdoc/doc-ditroff b/tmac/mdoc/doc-ditroff
index bda0c869c..0d7dd4e04 100644
--- a/tmac/mdoc/doc-ditroff
+++ b/tmac/mdoc/doc-ditroff
@@ -173,39 +173,6 @@
 .ds Am &
 .
 .
-.\" NS doc-header-string global string
-.\" NS   the final string used for the manual page header
-.
-.ds doc-header-string
-.
-.
-.\" NS doc-setup-header macro
-.\" NS   install and initialize header and footer support
-.\" NS
-.\" NS modifies:
-.\" NS   doc-header-string
-.\"
-.\" TODO: Support man(7)'s `FT` register.
-.
-.eo
-.de doc-setup-header
-.  ds doc-header-string "\*[doc-document-title]
-.  if !"\*[doc-section]"" \
-.    as doc-header-string \|(\*[doc-section])
-.
-.  br
-.
-.  if !\n[cR] \{\
-.    wh 0 doc-header
-.    wh -1.0i doc-break-body-text
-.    wh -.5i doc-footer
-.  \}
-.
-.  e@ doc-end-macro
-..
-.ec
-.
-.
 .\" NS doc-get-width macro
 .\" NS   computes the width of a string as a multiple of
 .\" NS   'doc-fixed-width': '.doc-get-width string'
diff --git a/tmac/mdoc/doc-nroff b/tmac/mdoc/doc-nroff
index 3cfbb71d0..1a1b7d4da 100644
--- a/tmac/mdoc/doc-nroff
+++ b/tmac/mdoc/doc-nroff
@@ -178,39 +178,6 @@
 .\}
 .
 .
-.\" NS doc-header-string global string
-.\" NS   the final string used for the manual page header
-.
-.ds doc-header-string
-.
-.
-.\" NS doc-setup-header macro
-.\" NS   install and initialize header and footer support
-.\" NS
-.\" NS modifies:
-.\" NS   doc-header-string
-.\"
-.\" TODO: Support man(7)'s `FT` register.
-.
-.eo
-.de doc-setup-header
-.  ds doc-header-string "\*[doc-document-title]
-.  if !"\*[doc-section]"" \
-.    as doc-header-string \|(\*[doc-section])
-.
-.  br
-.
-.  if !\n[cR] \{\
-.    wh 0 doc-header
-.    wh -1.0i doc-break-body-text
-.    wh -.5i doc-footer
-.  \}
-.
-.  e@ doc-end-macro
-..
-.ec
-.
-.
 .\" NS doc-get-width macro
 .\" NS   computes the width of a string as a multiple of
 .\" NS   'doc-fixed-width': '.doc-get-width string'



reply via email to

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