bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug #66006] [grog] Identifies .TS .TH .TE as a -man document


From: Morten Bo Johansen
Subject: Re: [bug #66006] [grog] Identifies .TS .TH .TE as a -man document
Date: Sat, 20 Jul 2024 20:45:51 +0200
User-agent: slrn/pre1.0.4-5 (Linux)

On 2024-07-20 G. Branden Robinson wrote:

> There are limits to any heuristic tool's inferential power when presented with
> very small inputs as we might see with minimal bug reproducers.  It's hard to
> accurately guess which macro package, if any, the input uses when there hardly
> *is* any input.
>
> But, I'd like to think something can be done in this case.

[ I couldn't submit this via Savannah's clunky interface, it was rejected .. ]

Just a shot from the hip: In a shell, I believe the following
idea basically solves the problem:

  grep -E -n "\.TH|\.TS|\.TE" groff-tbl.troff | head -1

This would return 

  3:.TS H

from the table file that demonstrated the problem. Since it is
a ".TS" macro, the document is not a -man document. In other
words, one can just check if the first macro returned is a
".TH" macro and then it is a -man document, otherwise not. If
you could apply the finishing touches and convert to perl,
wouldn't that be a good solution?

Regards,
Morten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]