summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2024-03-12 11:32:20 -0500
committerG. Branden Robinson <g.branden.robinson@gmail.com>2024-03-12 16:23:01 -0500
commita0d81b206a0f502cbf4b4e0381daa056f4888298 (patch)
tree9673afd73dad73c9dd35ca28c31f18d497fb07f6
parentba8081aab428f3e29bb8216a21020dfdad30399a (diff)
[mdoc]: Improve diagnostic message format (1/4).
* tmac/doc.tmac: Add new `doc` string recording the name the macro package self-reports. Use it when issuing diagnostics about rendering parameters (register and string settings) that can't be honored. See <https://www.gnu.org/prep/standards/standards.html#Errors>.
-rw-r--r--ChangeLog9
-rw-r--r--tmac/doc.tmac17
2 files changed, 19 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 2cc2beadc..9fcaf83f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-03-12 G. Branden Robinson <g.branden.robinson@gmail.com>
+
+ [mdoc]: Improve diagnostic message format (1/4).
+
+ * tmac/doc.tmac: Add new `doc` string recording the name the
+ macro package self-reports. Use it when issuing diagnostics
+ about rendering parameters (register and string settings) that
+ can't be honored.
+
2024-03-07 G. Branden Robinson <g.branden.robinson@gmail.com>
* src/roff/troff/input.cpp: Trivially refactor.
diff --git a/tmac/doc.tmac b/tmac/doc.tmac
index 36817e33c..45f12cda5 100644
--- a/tmac/doc.tmac
+++ b/tmac/doc.tmac
@@ -55,8 +55,11 @@
.cp 0
.
.
+.\" Define a string for use in diagnostic messages.
+.ds doc doc.tmac\"
+.
.if (\n[.x]\n[.y] < 118) \{\
-. ds doc-msg doc.tmac: groff mdoc macros require groff 1.18 or later,
+. ds doc-msg \*[doc]: groff mdoc macros require groff 1.18 or later,
. as doc-msg " but found groff \n[.x].\n[.y]; aborting
. ab \*[doc-msg]
.\}
@@ -85,7 +88,7 @@
.el \
. if !\n[C] \
. if \n[doc-is-output-html] \{\
-. tm mdoc: consecutive page numbering required for HTML output
+. tm \*[doc]: consecutive page numbering required for HTML output
. nr C 1
. \}
.if \n[doc-is-output-html] \
@@ -115,7 +118,7 @@
.el \
. if \n[D] \
. if \n[doc-is-output-html] \{\
-. tm mdoc: ignoring double-sided layout in HTML output
+. tm \*[doc]: ignoring double-sided layout in HTML output
. nr D 0
. \}
.
@@ -151,7 +154,7 @@
. \}
. \}
. if d doc-msg \{\
-. tm mdoc: ignoring \*[doc-msg]
+. tm \*[doc]: ignoring \*[doc-msg]
. rr FT
. rm doc-msg
. \}
@@ -202,7 +205,7 @@
. ds doc-msg when continuously rendering
.\}
.if d doc-msg \{\
-. tm mdoc: ignoring starting page number \*[doc-msg]
+. tm \*[doc]: ignoring starting page number \*[doc-msg]
. rr P
. rm doc-msg
.\}
@@ -221,7 +224,7 @@
.\" Also, we can't use the `P` register with grohtml at all.
.ie \n[doc-is-output-html] \{\
. if r P \{\
-. tm mdoc: ignoring starting page number in HTML output
+. tm \*[doc]: ignoring starting page number in HTML output
. rr P
. \}
.\}
@@ -252,7 +255,7 @@
. ds doc-msg when continuously rendering
.\}
.if d doc-msg \{\
-. tm mdoc: ignoring page number suffix \*[doc-msg]
+. tm \*[doc]: ignoring page number suffix \*[doc-msg]
. rr X
. rm doc-msg
.\}