groff-commit
[Top][All Lists]
Advanced

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

[groff] 04/19: [troff]: Throw error when `tr`ing from a space.


From: G. Branden Robinson
Subject: [groff] 04/19: [troff]: Throw error when `tr`ing from a space.
Date: Wed, 6 Jul 2022 15:45:43 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit ab5d7f57b19db156f442a6855bd8bcf37662c560
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Wed Jul 6 00:57:08 2022 -0500

    [troff]: Throw error when `tr`ing from a space.
    
    * src/roff/troff/input.cpp (do_translate): Throw an error diagnostic
      when the user attempts to translate space characters.  (By contrast,
      translating _to_ [unbreakable, unadjustable] spaces is an old troff
      hack often seen as ".tr ~ ", and largely superseded by groff's "\~"
      escape sequence, now widely supported by troffs.)
    
    Fixes <https://savannah.gnu.org/bugs/?60803>.  Thanks to T. Kurt Bond
    and Oliver Corff for the report.
---
 ChangeLog                | 12 ++++++++++++
 src/roff/troff/input.cpp |  1 +
 2 files changed, 13 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 5e9f9d00..d0c8153d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2022-07-06  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/roff/troff/input.cpp (do_translate): Throw an error
+       diagnostic when the user attempts to translate space characters.
+       {By contrast, translating _to_ [unbreakable, unadjustable]
+       spaces is an old troff hack often seen as ".tr ~ ", and largely
+       superseded by groff's "\~" escape sequence, now widely supported
+       by troffs.}
+
+       Fixes <https://savannah.gnu.org/bugs/?60803>.  Thanks to T. Kurt
+       Bond and Oliver Corff for the report.
+
 2022-07-01  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/roff/groff/pipeline.c: Refactor.  Drop function rename via
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 75884297..c485b15a 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -6982,6 +6982,7 @@ static void do_translate(int translate_transparent, int 
translate_input)
       translate_space_to_dummy = tok.is_dummy();
       if (tok.is_newline() || tok.is_eof())
        break;
+      error("cannot translate space character; ignoring");
       tok.next();
       continue;
     }



reply via email to

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