groff
[Top][All Lists]
Advanced

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

Re: man: EX/EE nested within nf/fi


From: Alejandro Colomar
Subject: Re: man: EX/EE nested within nf/fi
Date: Mon, 17 Jun 2024 01:22:39 +0200

On Sun, Jun 16, 2024 at 05:16:25PM GMT, G. Branden Robinson wrote:
> Hi Alex,
> 
> At 2024-06-16T23:14:56+0200, Alejandro Colomar wrote:
> > Branden, how about using some register in EX/EE so that it can nest
> > within nf/fi?
> 
> In your scenario I would advise the following instead:
> 
> .TH foo 1 2024-06-16 "groff test suite"
> .SH Name
> foo \- frobnicate a bar
> .SH Description
> .nf
> .B #include <foo.h>
> .P
> .fi \" NEW
> .EX
> struct {
>       int a;
>       int b;
> };
> .EE
> .nf \" NEW
> .P
> .B "#include <bar.h>  /* foobar foobar foobar foobar foobar foobar */"
> .P
> .B #define BAR \[dq]bar\[dq]
> .fi

I've done that in

<https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/?id=a911df9e88dedc801bed50eb92c26002729af9c0>
commit a911df9e88dedc801bed50eb92c26002729af9c0
Author: Alejandro Colomar <alx@kernel.org>
Date:   Mon Jun 17 01:18:39 2024 +0200

    man/, share/mk/: Fix nested EX/EE within nf/fi
    
    EX/EE can't be nested within nf/ni.  The mandoc(1) reports weren't
    spurious.
    
    Re-enable the mandoc(1) warnings, and fix the code.
    
    Fixes: 31203a0c8dbf ("share/mk/: Globally disable two spurious mandoc(1) 
warnings")
    Link: <https://lists.gnu.org/archive/html/groff/2024-06/msg00019.html>
    Reported-by: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
    Cc: "G. Branden Robinson" <branden@debian.org>
    Signed-off-by: Alejandro Colomar <alx@kernel.org>

> 
> Nesting means more state to track and I don't want to reach for that as
> a first resort, and I suspect Ingo doesn't either.
> 
> > Well, since groff(1) doesn't behave as I want,
> 
> You _can_ always simply use a table.  But that has a cost in HTML output
> until https://savannah.gnu.org/bugs/?60052 is fixed.
> 
> Let me refer you back to our last deep dive together on this, in July
> 2022.
> 
> https://lore.kernel.org/linux-man/20220722033353.ap7aqxh6uhghdcxo@illithid/
> 
> > mandoc(1)'s diagnostic is a good advise that I'm writing source that
> > will misbehave.
> > 
> > Hopefully, we can fix this to nest nicely.
> 
> What's wrong with my foregoing exhibit, apart from spending two more
> kopecks?
> 
> Regards,
> Branden



-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature


reply via email to

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