Hi Klemens,

Ingo Schwarze wrote on Tue, Feb 18, 2020 at 04:30:53PM +0100:
> Klemens Nanni wrote on Mon, Feb 17, 2020 at 05:19:27PM +0100:

>> Patch was done with a VIM macro by adding a new line after each `.Sh'
>> line with the respective name but lowercased, so no typos in the added
>> strings.

> That placement triggers an issue that already existed before .Tg arrived.
> In some places in the formatters, nodes are iterated (mainly backwards)
> to see whether there are any other nodes in the same parent, mostly
> for spacing purposes, but sometimes also for other purposes.
> Some nodes ought to be transparent to such iterations.
> 
> Here are two examples; note the bogus blank line in the output after
> "DESCRIPTION" and before "text":
> 
>   $ mandoc -mdoc | ul
> .Sh DESCRIPTION
> .Sm off
> .Bl -tag -width Ds
> .It Cm text : Ar text
> text
> .El
> 
>   $ mandoc -mdoc | ul
> .Sh DESCRIPTION
> .ft B
> .Bd -unfilled
> text
> .Ed
> 
> Yes, this mostly happens with code of dubious style, but the new
> .Tg macro can trigger the issue, too.  With continuously improving
> low-level roff(7) support, more such nodes that need to be transparent
> in this way may appear in the future, so the issue is bound to
> become worse over time, and at least half a dozen such nodes already
> exist.  Hence i'm working on a general solution, but that doesn't
> need to delay any commit, of course.

So, i finally committed a patch for this class of issues.  That
patch turned out to be of somewhat scary size (+318 -252 lines
touching 10 files), but even though i wasn't aware of it, all that
was already broken before .Tg existed, so it needed fixing anyway.
A patch of this size carries a certain risk of regressions, but
given the nature of the changes, if there are any regressions, they
will most likely be minor formatting glitches.  Also, a significant
fraction of the changes is half-mechanical, except that each
individual place needed careful consideration whether or not it had
to be changed (many superficially similar places should not be
changed).  Anyway, the significant amount of automated tests that
i committed with the patch ought to further reduce the risk that
anything goes wrong in some major way.

I committed it right away because this is not the kind of patch
that anybody would want to review.  Even Kristaps would balk at
that, i guess.

Yours,
  Ingo

Reply via email to