gbranden pushed a commit to branch master
in repository groff.

commit ac0a98a7cf9e8d62229aa0b04f6fafe1f16e320d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Nov 23 10:25:23 2026 -0600

    [troff]: Revise identifier error diagnostics.
    
    * src/roff/troff/input.cpp: Much as we'd like to, we can't say what the
      consequence of an invalid identifier is; some requests, like `rm`,
      `rr`, and the dumpers (`pchar`, `pev`, etc.) skip over them; others
      abort their operation.  Some pretend that the invalid identifier isn't
      there and perform a surprising alternative operation (see, e.g.,
      Savannah #68954), but I am steadily removing that form of "error
      handling" from GNU troff.
    
      (diagnose_invalid_identifier, read_input_until_terminator): Drop
      potentially misleading gerunds from error messages.
---
 ChangeLog                | 13 +++++++++++++
 src/roff/troff/input.cpp |  9 ++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a63f16f7c..f595c221b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2026-11-23  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp: Revise identifier error diagnostics.
+       Much as we'd like to, we can't say what the consequence of an
+       invalid identifier is; some requests, like `rm`, `rr`, and the
+       dumpers (`pchar`, `pev`, etc.) skip over them; others abort
+       their operation.  Some pretend that the invalid identifier isn't
+       there and perform a surprising alternative operation (see, e.g.,
+       Savannah #68954), but I am steadily removing that form of "error
+       handling" from GNU troff.
+       (diagnose_invalid_identifier, read_input_until_terminator): Drop
+       potentially misleading gerunds from error messages.
+
 2026-11-23  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/env.cpp (environment_switch_request): Recast
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 448227421..4c29280c5 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -3374,7 +3374,8 @@ static void diagnose_invalid_identifier()
       && !tok.is_tab() && !tok.is_right_brace()
       // We don't want to give a warning for .el\{
       && !tok.is_left_brace())
-    error("ignoring identifier containing %1", tok.description());
+    // Some requests skip invalid identifiers; most abort the operation.
+    error("identifier containing %1 is invalid", tok.description());
 }
 
 symbol read_identifier(bool want_diagnostic)
@@ -3451,8 +3452,10 @@ static symbol read_input_until_terminator(bool 
want_diagnostic,
       // Of C0 controls, Solaris, Heirloom, and Plan 9 troff support
       // ^[BCEFG] (only) in identifiers.  DWB 3.3 supports none.
       assert(buf[i] != ' '); // ensure caller handled spaces
-      error("ignoring identifier containing invalid character code %1",
-           static_cast<int>(buf[i]));
+      // Some requests skip invalid identifiers; most abort the
+      // operation.
+      error("identifier containing invalid character code %1"
+           " is invalid", static_cast<int>(buf[i]));
       delete[] buf;
       return NULL_SYMBOL;
     }

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to