groff-commit
[Top][All Lists]
Advanced

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

[groff] 07/11: [mdoc]: Improve diagnostic message format (1/4).


From: G. Branden Robinson
Subject: [groff] 07/11: [mdoc]: Improve diagnostic message format (1/4).
Date: Wed, 13 Mar 2024 16:16:25 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit a0d81b206a0f502cbf4b4e0381daa056f4888298
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue Mar 12 11:32:20 2024 -0500

    [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>.
---
 ChangeLog     |  9 +++++++++
 tmac/doc.tmac | 17 ++++++++++-------
 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
 .\}



reply via email to

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