[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 37/39: [mdoc]: Support `SN` register.
From: |
G. Branden Robinson |
Subject: |
[groff] 37/39: [mdoc]: Support `SN` register. |
Date: |
Sat, 29 Oct 2022 15:00:00 -0400 (EDT) |
gbranden pushed a commit to branch master
in repository groff.
commit bb10a668e10e43f9ccb1727f9f82a1df1530e3b6
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Oct 29 12:28:45 2022 -0500
[mdoc]: Support `SN` register.
* tmac/doc.tmac: Recognize `SN` register if set on command line and use
groff man(7)-compatible default if it is not.
* tmac/mdoc/doc-common (Ss): Use this register instead of a literal.
* tmac/groff_mdoc.7.man (Formatting with groff, troff, and nroff):
Document it.
* NEWS: Update item.
Fixes part of <https://savannah.gnu.org/bugs/?62926>.
---
ChangeLog | 15 +++++++++++++++
NEWS | 2 +-
tmac/doc.tmac | 3 ++-
tmac/groff_mdoc.7.man | 16 +++++++++++-----
tmac/mdoc/doc-common | 2 +-
5 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2060a1a7b..bc2e58364 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2022-10-29 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [mdoc]: Support `SN` register to configure subsection heading
+ indentation.
+
+ * tmac/doc.tmac: Recognize `SN` register if set on command line
+ and use groff man(7)-compatible default if it is not.
+ * tmac/mdoc/doc-common (Ss): Use this register instead of a
+ literal.
+ * tmac/groff_mdoc.7.man (Formatting with groff, troff, and
+ nroff): Document it.
+ * NEWS: Update item.
+
+ Fixes part of <https://savannah.gnu.org/bugs/?62926>.
+
2022-10-29 G. Branden Robinson <g.branden.robinson@gmail.com>
[mdoc]: Support `IN` register to configure paragraph
diff --git a/NEWS b/NEWS
index 8e7f1f779..35e92a712 100644
--- a/NEWS
+++ b/NEWS
@@ -304,7 +304,7 @@ o The groff_man(7) man page documenting the groff
implementation of the
material supplemented with explanations, examples, and advice for the
reader who is not an expert in *roff systems or in writing man pages.
-o The doc (mdoc) macro package now honors the `C`, `HY`, and `IN`
+o The doc (mdoc) macro package now honors the `C`, `HY`, `IN`, and `SN`
registers as the an (man) package does.
o The e (me) macro package has changed its support for output line
diff --git a/tmac/doc.tmac b/tmac/doc.tmac
index 0894af9d0..860aa2420 100644
--- a/tmac/doc.tmac
+++ b/tmac/doc.tmac
@@ -131,7 +131,8 @@
.
.\" TODO: Implement P register.
.
-.\" TODO: Implement SN register.
+.\" Use -rSN=<xxx> to set the subsection heading indentation amount.
+.if !r SN .nr SN 3n
.
.\" TODO: Implement U register.
.
diff --git a/tmac/groff_mdoc.7.man b/tmac/groff_mdoc.7.man
index 931b9f59e..1e8e70445 100644
--- a/tmac/groff_mdoc.7.man
+++ b/tmac/groff_mdoc.7.man
@@ -4668,12 +4668,19 @@ devices.
.
.
.Pp
-The paragraph indentation amount can be changed by setting the register
-.Ql \&IN .
+The paragraph and subsection heading indentation amounts can be changed
+by setting the registers
+.Ql \&IN
+and
+.Ql SN ,
.
-.Dl groff \-Tutf8 \-rIN=5n \-mdoc foo.man | less \-R
+.Dl groff \-Tutf8 \-rIN=5n \rSN=2n \-mdoc foo.man | less \-R
.
-The default is 7.2 ens on typesetters and 7 ens on terminals.
+The default paragraph indentation is 7.2 ens on typesetters and 7 ens on
+terminals.
+.
+The default subsection heading indentation amount is 3\~ens;
+section headings are always set flush left.
.
.
.Pp
@@ -4723,7 +4730,6 @@ and
.\" or X is a mystery.
.Ql \&FT ,
.Ql P ,
-.Ql SN ,
and
.Ql X
registers,
diff --git a/tmac/mdoc/doc-common b/tmac/mdoc/doc-common
index d52983f3e..3fe7ded24 100644
--- a/tmac/mdoc/doc-common
+++ b/tmac/mdoc/doc-common
@@ -1498,7 +1498,7 @@
. sp \n[doc-paragraph-space]u
. if !\n[cR] \
. ne 3
-. in 3n
+. in \n[SN]u
.
. if '\*[.T]'pdf' \
. pdfbookmark 3 "\*[doc-subsection-heading]"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 37/39: [mdoc]: Support `SN` register.,
G. Branden Robinson <=