[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 06/14: [mdoc]: Trivially refactor (DRY).
From: |
G. Branden Robinson |
Subject: |
[groff] 06/14: [mdoc]: Trivially refactor (DRY). |
Date: |
Thu, 22 Feb 2024 17:49:15 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 9bd4ec6a8fd1af38438091340419c07338ec7ab0
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Feb 21 13:41:26 2024 -0600
[mdoc]: Trivially refactor (DRY).
* tmac/mdoc/doc-ditroff:
* tmac/mdoc/doc-nroff: Move string definitions that are identical from
here...
* tmac/mdoc/doc-common: ...to here.
---
ChangeLog | 9 +++++++++
tmac/mdoc/doc-common | 19 +++++++++++++++++++
tmac/mdoc/doc-ditroff | 18 +-----------------
tmac/mdoc/doc-nroff | 26 +++++---------------------
4 files changed, 34 insertions(+), 38 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5e39ad0dc..a6c5fc2ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-02-21 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [mdoc]: Trivially refactor (DRY).
+
+ * tmac/mdoc/doc-ditroff:
+ * tmac/mdoc/doc-nroff: Move string definitions that are
+ identical from here...
+ * tmac/mdoc/doc-common: ...to here.
+
2024-02-21 G. Branden Robinson <g.branden.robinson@gmail.com>
* tmac/mdoc/doc-nroff (ua): Define string as `ha` special
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index 821b12c2f..df1e39a10 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -32,6 +32,25 @@
.\" @(#)doc-common 8.1 (Berkeley) 06/08/93
.
.
+.\" The following strings are part of mdoc(7)'s documented interface.
+.ds <= \[<=]
+.ds >= \[>=]
+.ds aa \[aa]
+.ds ga \[ga]
+.ds q \[dq]
+.ds Lq \[lq]
+.ds Rq \[rq]
+.ds Ne \[!=]
+.ds Le \[<=]
+.ds Ge \[>=]
+.ds Lt <
+.ds Gt >
+.ds Pm \[+-]
+.ds Am &
+.ds Na \f[I]NaN\f[]
+.ds Ba \f[R]|\f[]
+.\" See doc-{ditroff,nroff} for `ua`, `Pi`, and `If`.
+.
.\" Macro Identifiers. For each user macro a corresponding register
.\" with the same name must exist. Its value must not be zero.
.
diff --git a/tmac/mdoc/doc-ditroff b/tmac/mdoc/doc-ditroff
index c940c43d9..928c2b6da 100644
--- a/tmac/mdoc/doc-ditroff
+++ b/tmac/mdoc/doc-ditroff
@@ -131,26 +131,10 @@
.ds doc-left-singlequote \[oq]
.ds doc-right-singlequote \[cq]
.
-.\" The following strings are part of mdoc(7)'s documented interface.
-.ds <= \[<=]
-.ds >= \[>=]
-.ds Lq \[lq]
-.ds Rq \[rq]
+.\" See doc-common for other string definitions.
.ds ua \[ua]
-.ds aa \[aa]
-.ds ga \[ga]
-.ds q \[dq]
.ds Pi \[*p]
-.ds Ne \[!=]
-.ds Le \[<=]
-.ds Ge \[>=]
-.ds Lt <
-.ds Gt >
-.ds Pm \[+-]
.ds If \[if]
-.ds Na \f[I]NaN\f[]
-.ds Ba \f[R]|\f[]
-.ds Am &
.
.
.\" NS doc-get-width macro
diff --git a/tmac/mdoc/doc-nroff b/tmac/mdoc/doc-nroff
index 2226b5754..aab8179d7 100644
--- a/tmac/mdoc/doc-nroff
+++ b/tmac/mdoc/doc-nroff
@@ -120,27 +120,11 @@
.ds doc-left-singlequote \[oq]
.ds doc-right-singlequote \[cq]
.
-.\" The following strings are part of mdoc(7)'s documented interface.
-.ds <= \[<=]
-.ds >= \[>=]
-.ds aa \[aa]
-.ds ga \[ga]
-.ds q \[dq]
-.ds Lq \[lq]
-.ds Rq \[rq]
-.ds Ne \[!=]
-.ds Le \[<=]
-.ds Ge \[>=]
-.ds Lt <
-.ds Gt >
-.ds Pm \[+-]
-.ds Na \f[I]NaN\f[]
-.ds Ba \f[R]|\f[]
-.ds Am &
-.
-.\" Unicode TTYs have all glyph forms; for other TTY character sets we
-.\" need character representations which are different from GNU troff's
-.\" standard forms.
+.\" Unicode-capable terminals have all desired glyphs; for other
+.\" terminals' character sets we need representations that differ from
+.\" typesetters'.
+.\"
+.\" See doc-common for other string definitions.
.ie '\*[.T]'utf8' \{\
. ds ua \[ua]
. ds Pi \[*p]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 06/14: [mdoc]: Trivially refactor (DRY).,
G. Branden Robinson <=