groff-commit
[Top][All Lists]
Advanced

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

[groff] 04/15: [troff]: Recast awful "transparently" diagnostic.


From: G. Branden Robinson
Subject: [groff] 04/15: [troff]: Recast awful "transparently" diagnostic.
Date: Thu, 12 Oct 2023 21:55:06 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 6fb16f080efe8b602c5675a4fc4faa4012391b0f
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Oct 7 18:12:50 2023 -0500

    [troff]: Recast awful "transparently" diagnostic.
    
    * src/roff/troff/input.cpp (token::next, device_macro_request): Recast
      language of one of groff's more notorious diagnostics, eliminating the
      much-abused word "transparently".  Also name the offending token.  It
      is difficult to overstate how unhelpful diagnostic messages are when
      they know precisely what is wrong but refuse to tell the user.
    
    Tested as follows.
    
    $ printf '.devicem br\n\\Y(br\n' | ./build/test-groff -z
    troff:<standard input>:1: error: cannot interpolate 'br' to 
device-independent output; it is a request, not a macro
    troff:<standard input>:2: error: cannot interpolate 'br' to 
device-independent output; it is a request, not a macro
    
    Lengthy beats incomprehensible.
    
    (One might quibble over my choice of preposition; I was torn between
    "to" and "in".)
---
 ChangeLog                | 9 +++++++++
 src/roff/troff/input.cpp | 7 +++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1f33ff303..b403e1324 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-10-07  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp (token::next, device_macro_request):
+       Recast language of one of groff's more notorious diagnostics,
+       eliminating the much-abused word "transparently".  Also name the
+       offending token.  It is difficult to overstate how unhelpful
+       diagnostic messages are when they know precisely what is wrong
+       but refuse to tell the user.
+
 2023-10-07  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/troff/input.cpp (token::next): Tweak language of
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 873c544d1..5a17bd480 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2354,7 +2354,9 @@ void token::next()
          request_or_macro *p = lookup_request(s);
          macro *m = p->to_macro();
          if (!m) {
-           error("can't transparently throughput a request");
+           error("cannot interpolate '%1' to device-independent"
+                 " output; it is a request, not a macro",
+                 s.contents());
            break;
          }
          nd = new special_node(*m);
@@ -5672,7 +5674,8 @@ void device_macro_request()
     if (m)
       curenv->add_node(new special_node(*m));
     else
-      error("can't transparently throughput a request");
+      error("cannot interpolate '%1' to device-independent output;"
+           " it is a request, not a macro", s.contents());
   }
   skip_line();
 }



reply via email to

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