Follow-up Comment #10, bug #67939 (group groff): At 2026-02-01T09:59:02-0500, Dave wrote: > Follow-up Comment #9, bug #67939 (group groff): > > [comment #8 comment #8:] >> in theory, `length` might be broken enough that we'll >> _have_ to replace it. Hmm, I can't find the ticket for this. > > Bug #67231 started off reporting a defect in .length that ended up > getting demoted to a documentation change. Its initial comment > referenced "a separate but closely related problem with `length`, > which I will file as a separate ticket," but this teaser was never > followed up on in this ticket, and no later tickets seem obvious > candidates ... So this promised .length ticket > may never have been filed.
Aha, thanks! That is indeed what I was thinking of.
I see that I chickened out in comment #2 of bug #67231.
And I see why my ticket search failed. I looked for _open_ bugs
matching "length". Tut-tut.
> (though it's hard to tell because the statement is so vague about what
> the related problem is)
I may not have known at the time, and I wouldn't want to try to explain
now in official documentation, but it has to do with the way troff (any
troff, really) processes its input. The system is fundamentally a
recursive macro expander that doesn't generally read ahead in its input,
and the `length` request doesn't read its argument in copy mode,
so when you ask it to measure something, it measures the result of
recursive interpolation (macro expansion) on its argument. What people
likely expect, in some cases, is for it to look up a string/macro/
diversion by name, extract some kind of "length" datum from it, and
report it.
That's a reasonable enough expectation, and we could actually do that,
but the `length` request is not specified in a manner supporting it.
(In fact the whole point of copy mode, as I understand it, is to make
the formatter temporarily stop being a recursive macro expander. Except
copy mode performs some interpolations anyway, including on strings,
because THIS! IS! BELL LABS! I'm sure it was expedient at the time.)
Instead, you're _expected_ to supply only "literal text" as the argument
to the `length` request, or a string interpolation `\*[like-this]`,
_and_ you are expected _not_ to pun a macro or diversion name by using
string interpolation on it.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67939>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
