Hi Branden! On 5/31/23 22:58, G. Branden Robinson wrote: > Hi Alex, > > At 2023-05-22T18:40:28+0200, Alejandro Colomar wrote: >> I had a typo in a man(7) page where for some reason I slipped an .IP >> in the wrong place. I had no warnings about that IP. Neither >> groff(1) nor mandoc(1) complained about it. And BTW, mandoc(1)'s >> behavior seems the right one to me. > > Long story short: I agree; please file a Savannah ticket.> > https://savannah.gnu.org/bugs/?group=groff&func=additem
Will do; thanks for the link. > > Longer story: the issue is input of this form. > >> .PD 0 >> .IP \[bu] 3 >> fgh. >> .IP >> .PD >> .SH jkl >> zxc. > > I would not expect any man(7) formatter to warn about this. The empty > paragraph body is not inherently erroneous. mandoc(1) warns about empty paragraphs. I believe it should warn in this case too. $ cat ip.man .TH A s 2000-02-02 f .SH Foo .IP foo .IP .SH Bar bar $ mandoc -Tlint ip.man mandoc: ip.man:5:2: WARNING: skipping paragraph macro: IP empty This warning is very useful, and has caught many many mistakes in the Linux man-pages. > Consider a situation where > we're setting tagged paragraphs for the sake of their tags alone. > > ---begin snip--- > .SH Monsters > In this game reminiscent of > .MR rogue 6 , > you can expect to encounter the following opponents in increasing order > of menace. > . > .PD 0 \" possible future: `.LS` > .IP B > .IP T > .IP D > .PD \" possible future: `.LE` > .SH Treasure > ---end snip--- Here was a difference: the paragraphs did have at least a "bullet". In the report, there's nothing at all. mandoc(1) doesn't warn here: $ cat ip2.man .TH A s 2000-02-02 f .SH Foo .IP foo .IP B .SH Bar bar $ mandoc -Tlint ip2.man > > While I have proposed that `TP` be used for tags of indexable or > semantic import, and `IP` for other sorts like bullets and list > enumerators, whether it would be better to use `TP` for this application > has no bearing here in my view. Yeah, I'd definitely prefer TP/TQ in this case. In fact, IIRC, I fixed cases of this exact thing in the Linux man-pages recently. The arguments to IP are not bullets, or enumerators, but actual tags. > > I'll have a look at fixing this for groff-next--maybe in 1.23.1 point > release if the solution turns out to be low impact. > > Regards, > Branden Cheers, Alex P.S.: I just read your suggestion of using I instead of IR for trailing punctuation after variable names. I'm not convinced at all. It's more correct/precise to use IR, and the difference in typeset output is probably minor. -- <http://www.alejandro-colomar.es/> GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
OpenPGP_signature
Description: OpenPGP digital signature