URL:
  <https://savannah.gnu.org/bugs/?67842>

                 Summary: [troff] absurdly accepts delimited escape sequences
as delimiters to another delimited escape sequence
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Sun 21 Dec 2025 04:27:30 PM UTC
                Category: Core
                Severity: 3 - Normal
              Item Group: Incorrect behaviour
                  Status: In Progress
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Unlocked
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sun 21 Dec 2025 04:27:30 PM UTC By: G. Branden Robinson <gbranden>
...absurdly and implicitly contrary to our documentation.

Our Texinfo manual said back in _groff_ 1.22.3:


   The following escapes sequences (which are handled similarly to
characters since they don't take a parameter) are also allowed as
delimiters: '\%', '\ ', '\|', '\^', '\{', '\}', '\'', '\`', '\-', '\_',
'\!', '\?', '\)', '\/', '\,', '\&', '\:', '\~', '\0', '\a', '\c', '\d',
'\e', '\E', '\p', '\r', '\t', and '\u'.  Again, don't use these if
possible.


And yet \C, which _does_ take a parameter, *is* allowed as a delimiter.


$ printf 'foo\\h\\C!em!5m\\C!em!bar\n' | ~/groff-1.22.3/bin/groff -T ascii |
cat -s
foo     bar


The intention was, I think, to support parameterized *but non-delimited*
special character escape sequences like `\(em` and `\[em]`.  This feature is
in fact used by GNU _tbl_ and _eqn_, where otherwise undefined special
characters `\[tbl]` and `\(EQ`. are employed solely for use as delimiters.

The reason `\C` could also be used as delimiter, despite itself being
delimited, is, I think, because it has been tokenized into the same
equivalence class as `\(` and `\[]`, `TOKEN_SPECIAL_CHAR`.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67842>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to