[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 02/08: [mdoc]: Reserve registers used by groff_man(7).
From: |
G. Branden Robinson |
Subject: |
[groff] 02/08: [mdoc]: Reserve registers used by groff_man(7). |
Date: |
Sat, 31 Oct 2020 23:48:21 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit 8c25d2a1ed2f0046b355b640ed09626c01ac3b7d
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Oct 31 22:17:10 2020 +1100
[mdoc]: Reserve registers used by groff_man(7).
* tmac/mdoc/doc-ditroff-u:
* tmac/mdoc/doc-nroff-u: Recognize but ignore the groff_man(7) string HF
and registers FT, IN, P, SN, and X (by initializing them empty or
zero if they are not set). This reserves them so that they don't
become used for divergent purposes. man(1) programs set these and
other parameters already handled (like LL) to configure page
rendering, and it would break the macro-package agnostisicm afforded
by andoc.tmac to expose different externally-programmable registers
and strings.
* tmac/groff_mdoc.7.man (Formatting with groff, troff, and nroff):
Document this.
Strictly, these registers/strings could be reserved "harder" by setting
them unconditionally, but that doesn't seem necessary, and this way if
any does become supported, it needs only its default changed (and to be
otherwise implemented).
---
ChangeLog | 14 ++++++++++++++
tmac/groff_mdoc.7.man | 22 ++++++++++++++++++++--
tmac/mdoc/doc-ditroff-u | 20 +++++++++++++++++++-
tmac/mdoc/doc-nroff-u | 20 +++++++++++++++++++-
4 files changed, 72 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a0b6b9d..8a5d89e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
2020-10-31 G. Branden Robinson <g.branden.robinson@gmail.com>
+ * tmac/mdoc/doc-ditroff-u:
+ * tmac/mdoc/doc-nroff-u: Recognize but ignore the groff_man(7)
+ string HF and registers FT, IN, P, SN, and X (by initializing
+ them empty or zero if they are not set). This reserves them
+ so that they don't become used for divergent purposes. man(1)
+ programs set these and other parameters already handled (like
+ LL) to configure page rendering, and it would break the
+ macro-package agnostisicm afforded by andoc.tmac to expose
+ different externally-programmable registers and strings.
+ * tmac/groff_mdoc.7.man \
+ (Formatting with groff, troff, and nroff): Document this.
+
+2020-10-31 G. Branden Robinson <g.branden.robinson@gmail.com>
+
* tmac/s.tmac: Implement \*< and \*> strings for subscripting.
groff ms has had (extension) strings for superscripting since
1991 at the latest, and the asymmetry possessed me of a madness.
diff --git a/tmac/groff_mdoc.7.man b/tmac/groff_mdoc.7.man
index 538df71..65d0468 100644
--- a/tmac/groff_mdoc.7.man
+++ b/tmac/groff_mdoc.7.man
@@ -4216,10 +4216,28 @@ Hyphenation can be disabled with the
register (though any permissible hyphenation mode may be used).
.Pp
.Dl groff \-Tutf8 -rHY=0 \-mdoc foo.man | less
+.
+.
.Pp
-An
.Ql AD
-string is also recognized, but ignored, for compatibility with
+and
+.Ql HF
+strings,
+and
+.\" XXX: FT and IN have to be protected with ampersands because when
+.\" rendering via andoc and having already seen a man(7) page, .Ql
+.\" mis-handles them. Why this is not true of AD, cR, D, HF, HY, P, SN,
+.\" or X is a mystery.
+.Ql \&FT ,
+.Ql \&IN ,
+.Ql P ,
+.Ql SN ,
+and
+.Ql X
+registers,
+are also recognized
+(but ignored)
+for compatibility with
.Xr groff_man 7 .
.
.
diff --git a/tmac/mdoc/doc-ditroff-u b/tmac/mdoc/doc-ditroff-u
index bd87b16..092ea8f 100644
--- a/tmac/mdoc/doc-ditroff-u
+++ b/tmac/mdoc/doc-ditroff-u
@@ -37,7 +37,7 @@
.eo
.
.\" \*[AD] is recognized for groff_man(7) compatibility, but ignored.
-.if !d AD .ds AD \"
+.if !d AD .ds AD \" empty
.
.\" use -rD=1 for double-sided printing
.if !r D .nr D 0
@@ -45,6 +45,12 @@
.\" use -rcR=1 to force the creation of a single, very long page
.if !r cR .nr cR 0
.
+.\" \n[FT] is recognized for groff_man(7) compatibility, but ignored.
+.if !r FT .nr FT 0
+.
+.\" \*[HF] is recognized for groff_man(7) compatibility, but ignored.
+.if !d HF .ds HF \" empty
+.
.\" \n[HY] is recognized for groff_man(7) compatibility, particuarly via
.\" andoc.tmac and man(1); see \n[doc-hyphen-flags] in doc-common.
.ec
@@ -57,6 +63,12 @@
.\}
.eo
.
+.\" \n[IN] is recognized for groff_man(7) compatibility, but ignored.
+.if !r IN .nr IN 0
+.
+.\" \n[P] is recognized for groff_man(7) compatibility, but ignored.
+.if !r P .nr P 0
+.
.\" use -rS={11,12} to change the font size from 10pt to 11pt or 12pt.
.if !r S .nr S 10
.
@@ -78,6 +90,12 @@
.\}\}
.
.
+.\" \n[SN] is recognized for groff_man(7) compatibility, but ignored.
+.if !r SN .nr SN 0
+.
+.\" \n[X] is recognized for groff_man(7) compatibility, but ignored.
+.if !r X .nr X 0
+.
.\" the 'doc-xx-font' strings must not be empty!
.
.ds doc-caption-font \f[R]\s[\n[.ps]u]
diff --git a/tmac/mdoc/doc-nroff-u b/tmac/mdoc/doc-nroff-u
index 0814c31..bd101c4 100644
--- a/tmac/mdoc/doc-nroff-u
+++ b/tmac/mdoc/doc-nroff-u
@@ -37,7 +37,7 @@
.eo
.
.\" \*[AD] is recognized for groff_man(7) compatibility, but ignored.
-.if !d AD .ds AD \"
+.if !d AD .ds AD \" empty
.
.\" use -rD=1 for double-sided printing
.if !r D .nr D 0
@@ -45,6 +45,12 @@
.\" use -rcR=0 for multiple pages instead of a single, very long page
.if !r cR .nr cR 1
.
+.\" \n[FT] is recognized for groff_man(7) compatibility, but ignored.
+.if !r FT .nr FT 0
+.
+.\" \*[HF] is recognized for groff_man(7) compatibility, but ignored.
+.if !d HF .ds HF \" empty
+.
.\" \n[HY] is recognized for groff_man(7) compatibility, particuarly via
.\" andoc.tmac and man(1); see \n[doc-hyphen-flags] in doc-common.
.ec
@@ -57,9 +63,21 @@
.\}
.eo
.
+.\" \n[IN] is recognized for groff_man(7) compatibility, but ignored.
+.if !r IN .nr IN 0
+.
+.\" \n[P] is recognized for groff_man(7) compatibility, but ignored.
+.if !r P .nr P 0
+.
.\" the following switch is ignored in nroff mode
.nr S 10
.
+.\" \n[SN] is recognized for groff_man(7) compatibility, but ignored.
+.if !r SN .nr SN 0
+.
+.\" \n[X] is recognized for groff_man(7) compatibility, but ignored.
+.if !r X .nr X 0
+.
.\" the 'doc-xx-font' strings must not be empty!
.
.ds doc-caption-font \f[R]
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 02/08: [mdoc]: Reserve registers used by groff_man(7).,
G. Branden Robinson <=