groff-commit
[Top][All Lists]
Advanced

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

[groff] 08/80: [troff]: Fix Savannah #66481 and unfix #66099.


From: G. Branden Robinson
Subject: [groff] 08/80: [troff]: Fix Savannah #66481 and unfix #66099.
Date: Sat, 30 Nov 2024 04:02:12 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit d052cb31d9982ef2ad1d776d828bd4370ce5e43e
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Mon Nov 25 17:13:56 2024 -0600

    [troff]: Fix Savannah #66481 and unfix #66099.
    
    * src/roff/troff/input.cpp (is_char_usable_as_delimiter): Revert fix for
      bug #66009.  Unfortunately, `|` is in use in the wild as a delimiter,
      for instance in man pages for GNU awk, GNU grep, and GNU rcs.  Weaning
      people off of it (because it is a valid character in a numeric
      expression, and GNU troff has never accepted most other such
      characters as delimeters,{*} whereas AT&T troff accepted them all)
      looks to be a multi-stage, multi-year process.
    
    Fixes <https://savannah.gnu.org/bugs/?66481>.  Thanks to Paul Eggert for
    the report.
    
    {*} For distorted values of "most"--both GNU and AT&T troffs accept any
        basic Latin letter ([A-Za-z]) as a delimiter, a collection of 52
        exceptions that quantitatively swallows the rule.  Pragmatically,
        few *roff document authors past or present seem to have been
        adventurous enough to exercise this freedom.
---
 ChangeLog                | 20 ++++++++++++++++++++
 src/roff/troff/input.cpp |  6 +++++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 29b39589d..632af271d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2024-11-25  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp (is_char_usable_as_delimiter):
+       Revert fix for bug #66009.  Unfortunately, `|` is in use in the
+       wild as a delimiter, for instance in man pages for GNU awk, GNU
+       grep, and GNU rcs.  Weaning people off of it (because it is a
+       valid character in a numeric expression, and GNU troff has never
+       accepted most other such characters as delimeters,{*} whereas
+       AT&T troff accepted them all) looks to be a multi-stage,
+       multi-year process.
+
+       Fixes <https://savannah.gnu.org/bugs/?66481>.  Thanks to Paul
+       Eggert for the report.
+
+       {*} For distorted values of "most"--both GNU and AT&T troffs
+       accept any basic Latin letter (A-Za-z]) as a delimiter, a
+       collection of 52 exceptions that quantitatively swallows the
+       rule.  Pragmatically, few *roff document authors past or present
+       seem to have been adventurous enough to exercise this freedom.
+
 2024-11-22  Paul Eggert  <eggert@cs.ucla.edu>
 
        * arch/djgpp/config.sed:
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 61029bab6..38b26f1e4 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2609,8 +2609,12 @@ static bool is_char_usable_as_delimiter(int c)
   case '(':
   case ')':
   case '.':
-  case '|':
     return false;
+  // TODO: In groff 1.25, style-warn on '|' and [A-Za-z].
+  // TODO: In groff 1.26, promote style warning to error with
+  // deprecation message.
+  // TODO: In groff 1.27, make '|' and letters return false.
+  // See Savannah #66481.
   default:
     return true;
   }



reply via email to

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