Hi Dave! At 2021-02-26T20:19:11-0600, Dave Kemper wrote: > On 2/25/21, G. Branden Robinson <[email protected]> wrote: > > So I could use the help of a practiced me(7) user, particularly of > > the macros noted in Werner's commit above, to verify that my fix has > > not regressed desirable me(7) behavior. > > I'm one of the more vocal -me users here, but I've never used tbl, so > I have no insight into the macros Werner referenced or the problem he > was addressing with his changes. > > > it would probably regress the problem originally observed. However, > > I don't know what it was; traffic on this list for July 2011 doesn't > > reveal anything. > > A note on bug-groff from May 2011 seems to correspond to the commit in > question: > > http://lists.gnu.org/archive/html/bug-groff/2011-05/msg00000.html > > Werner replied on that list in July, though part of the thread is > missing from the archive for reasons that are unexplained.
Big thanks for this!
The good news is that the original reporter, George Helffrich, made his
reproducing case document a monograph on the underlying issues. This is
really helpful to me, as I had _no_ idea why tbl(1) was doing the
elaborate dance that it was. Hellfrich's document makes it clear that
the complexity is due to the variable nesting depth of active
diversions.
One of Helffrich's paragraphs in particular is worth quoting:
The main change to make numbering work properly within tables
was to turn off numbering in diverted text and restore it [only
when] the diversions were reassembled at the topmost level to
produce the printed page. The challenge doing this is to design
a scheme that can handle the many levels of diversions in
tables. Simple table have only a single level. Drawing boxes
around table entries involves yet another level of diversion.
Finally, text blocks [...] involve yet another level of
diversion.
I wish the above had been put into (1) code comments in table.cpp; (2)
the groff ChangeLog; and/or (3) the commit message in which the change
was made. It is great stuff for demystification purposes, particularly
since the scheme as implemented uses challengingly short macro names
"3rlns" and "3rlnx" that take single-letter arguments ("d", "m", "c") to
control their behavior. Someone was going for a Ken Thompson Brevity
Award. >:(
The bad news is that my change did indeed cause regressions from groff
1.22.4; see the attached files. I will dig into this, but with
Helffrich's road map it should be much easier to figure out in which
places I should back off from my scatter-gun .if \n[.nm] approach.
I think Werner did end up altering me(7)'s .n2 differently than George,
so I'll have to sort that out, too.
But ultimately I expect to come out of this with more test cases so no
one ever has to go through this again. :)
Regards,
Branden
tbltest.me
Description: Troff ME-macros document
helffrich-1.22.4.ps
Description: PostScript document
helffrich-head.ps
Description: PostScript document
signature.asc
Description: PGP signature
