URL: <https://savannah.gnu.org/bugs/?67703>
Summary: [troff] character removal/clobbering is incomplete
and underspecified
Group: GNU roff
Submitter: gbranden
Submitted: Sat 15 Nov 2025 05:26:56 PM UTC
Category: Core
Severity: 3 - Normal
Item Group: Incorrect behaviour
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Sat 15 Nov 2025 05:26:56 PM UTC By: G. Branden Robinson <gbranden>
Observe.
$ ./build/test-groff
.char \[fakechar] utterly_bogus
.cflags 32 \[fakechar]
.pchar \[fakechar]
special character 'fakechar'
is not translated
has a macro: "file name": "<standard input>", "starting line number": 1,
"length": 13, "contents": "utterly_bogus", "node list": [ ]
special translation: 0
hyphenation code: 0
flags: 32 (is transparent to end of sentence)
asciify code: 0
ASCII code: 0
Unicode mapping: none (-1)
is found
is transparently translatable
is not translatable as input
mode: normal
.rchar \[fakechar]
.pchar \[fakechar]
special character 'fakechar'
is not translated
does not have a macro
special translation: 0
hyphenation code: 0
flags: 32 (is transparent to end of sentence)
asciify code: 0
ASCII code: 0
Unicode mapping: none (-1)
is found
is transparently translatable
is not translatable as input
mode: normal
I propose that when a user-defined character (or character class) is removed
with the `rchar` request, all of its properties should be removed, not just
the macro definition.
This rule would also apply to clobbering/redefinition of an existing
character. That would be a little more complicated.
1. The rule above would apply to a clobbered character class, which has only
two properties ("ranges", and "nested classes").
2a. If an existing special character is replaced by character class, the
existing special character should be fully removed as in the case above.
2b. If an existing special character is replaced by another existing special
character, what's the right thing to do? Yes, would just copy all the
properties of the character being copied in (the "\[b]" of `.char \[a] \[b]`),
but what if that's not all there is in the new definition? What if the RHS is
complex? Consider `.char \[a] \[b]cdef`.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67703>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
