groff-commit
[Top][All Lists]
Advanced

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

[groff] 22/26: [troff]: Fix Savannah #66350 (WARN_MAC wording).


From: G. Branden Robinson
Subject: [groff] 22/26: [troff]: Fix Savannah #66350 (WARN_MAC wording).
Date: Thu, 14 Nov 2024 11:54:12 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 2cf26d72c595721f3a30a7b326b9a4505e9ce2ec
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Nov 13 13:58:44 2024 -0600

    [troff]: Fix Savannah #66350 (WARN_MAC wording).
    
    * src/roff/troff/input.cpp (interpolate_macro, lookup_request): Recast
      warning diagnostic in "mac" category to report that a "name", rather
      than a "macro", is not defined.  While more vague, it's also less
      misleading, since requests, strings, and diversions all occupy the
      same name space and the warning is thrown only if no identifier of any
      of these types exists.
    
    * doc/groff.texi.in (Dummy Characters): Update example.
    
    Fixes <https://savannah.gnu.org/bugs/?66350>.  Thanks to Bjarni Ingi
    Gislason for the report.
---
 ChangeLog                | 14 ++++++++++++++
 doc/groff.texi.in        |  2 +-
 src/roff/troff/input.cpp |  6 +++---
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cab0af86c..657e0e49f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2024-11-13  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp (interpolate_macro, lookup_request):
+       Recast warning diagnostic in "mac" category to report that a
+       "name", rather than a "macro", is not defined.  While more
+       vague, it's also less misleading, since requests, strings, and
+       diversions all occupy the same name space and the warning is
+       thrown only if no identifier of any of these types exists.
+
+       * doc/groff.texi.in (Dummy Characters): Update example.
+
+       Fixes <https://savannah.gnu.org/bugs/?66350>.  Thanks to Bjarni
+       Gislason for the report.
+
 2024-11-13  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/troff/input.cpp (lookup_request): Use C++
diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 342357214..ee514b259 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -11922,7 +11922,7 @@ Prevent recognition of a control character.
 
 @Example
 .Test
-    @error{} warning: macro 'Test' not defined
+    @error{} warning: name 'Test' not defined
 \&.Test
     @result{} .Test
 @endExample
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 17f30fdd9..8fafa8a0a 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -4056,14 +4056,14 @@ static void interpolate_macro(symbol nm, bool 
do_not_want_next_token)
       if (r) {
        macro *m = r->to_macro();
        if ((0 /* nullptr */ == m) || !m->is_empty()) {
-         warning(WARN_SPACE, "macro '%1' not defined (possibly missing"
+         warning(WARN_SPACE, "name '%1' not defined (possibly missing"
                  " space after '%2')", nm.contents(), buf);
          was_warned = true;
        }
       }
     }
     if (!was_warned) {
-      warning(WARN_MAC, "macro '%1' not defined", nm.contents());
+      warning(WARN_MAC, "name '%1' not defined", nm.contents());
       p = new macro;
       request_dictionary.define(nm, p);
     }
@@ -9374,7 +9374,7 @@ static request_or_macro *lookup_request(symbol nm)
   request_or_macro *p
     = static_cast<request_or_macro *>(request_dictionary.lookup(nm));
   if (0 /* nullptr */ == p) {
-    warning(WARN_MAC, "macro '%1' not defined", nm.contents());
+    warning(WARN_MAC, "name '%1' not defined", nm.contents());
     p = new macro;
     request_dictionary.define(nm, p);
   }



reply via email to

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