Update of bug #67472 (group groff):
Summary: [troff] rename `asciify` request to `undivert` or
similar => [troff] rename `asciify` request to `textify`, `unformat` to
`undivert`?
_______________________________________________________
Follow-up Comment #1:
I am starting to think that `asciify`, which dates back to Clark, but for
which evident applications are scarce, was either intended to do what
subsequent "sanitization" macros have attempted, or was not completely
successful at what its intended purpose was.
"ChangeLog.old" doesn't shed much light.
$ grep -C1 asciify ChangeLog.old
(get_copy): Turn \E into ESCAPE_E.
(token::process, asciify): Handle ESCAPE_E.
--
* troff/input.c (asciify): By default, invalid input characters
should return empty string.
--
* troff/input.c (input_iterator::get): New function. Don't make
asciify_macro or class non_interpreted_node friends of class
input_iterator.
(non_interpreted_node::interpret): Use input_iterator::get.
(asciify_macro): Likewise.
--
* troff/input.c (asciify_macro): Make the string_iterator auto.
--
* troff/div.c (top_level_diversion::transparent_output(unsigned
char)): Use asciify.
* troff/input.c (asciify): Don't make it static.
* troff/token.h (asciify): Declare it.
--
* troff/node.c, troff/node.h: Add `asciify' methods to classes
derived from node. New class space_char_hmotion_node.
* troff/input.c (asciify_macro): New function.
* troff/input.c (init_input_requests): New request `asciify' bound
to asciify_macro.
* macros/mm.diff: New file.
--
* troff/input.c (abort_request): Use asciify.
Consider the way _ms_(7) handles author data: it populates a diversion.
That's inconvenient if you wanted to, say, store the authors' names in a
string for use in citations or as PDF metadata.
(A document could of course define its own strings to store just the author
names without further formatting, and interpolate them between `TL` and `AU`
calls, but that's beside the point. Clearly Clark thought `asciify` had
_some_ useful purpose.)
If I'm right then some of my experiments in my working copy earlier this week
were misguided (see bug #66653).
However, the operations I had in mind would still make sense for `unformat`.
I think the reversibility of the diversion process makes `undivert` a better
name for that request, and also permits us to escape the duty of explaining to
users which formatter operations constitute "formatting" and which don't.
Even `stringify` isn't the best name; a _groff_ string might not be able to
contain control lines (or, relatedly, newlines), but it can contain many
varieties of escape sequence that don't make sense as text for embedding in
PDF metadata (drawing commands, vertical motions, etc.).
Maybe `textify` is a better term. But `asciify` is the most misleading of all
because it can (and should) be able to house non-ASCII characters.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67472>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
