Re: man-pages.7: Simplify indentation of structure definitions, shell session logs, and so on

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

 



Hi Brnaden,

A ping on the below, in case you have some thoughts.

Thanks,

Michael

On Thu, 1 Oct 2020 at 09:33, Michael Kerrisk (man-pages)
<mtk.manpages@xxxxxxxxx> wrote:
>
> Hi Branden,
>
> Sorry -- I think I'm still not getting it.
>
> On Wed, 30 Sep 2020 at 14:54, G. Branden Robinson
> <g.branden.robinson@xxxxxxxxx> wrote:
> >
> > At 2020-09-30T22:02:43+1000, G. Branden Robinson wrote:
> > > [...] you can call .RE [...] as ".RE 2" to say "go back two
> > > indentation levels"
> >
> > Nope, that's wrong.  Forget I said that; I think I might now see
> > something I can further improve in the documentation.
> >
> > You can see I'm still bedeviled by relative insets.  :-|
> >
> > I tend to never use the argument to .RE; I just call .RE multiple times
> > to balance out my .RS calls, just like parentheses.  When I do that, I
> > don't get surprised.
> >
> > > without having to track or remember any indentation measurements.
> >
> > This part remains true.  :)
>
> Currently, I use the idiom
>
> .PP
> .in +4n
> .EX
> <code>
> .EE
> .in
> .PP
>
> or, if we're in indented paragraph territory:
>
> .IP
> .in +4n
> .EX
> <code>
> .EE
> .in
> .IP
>
> This is of course hacky, and of course in order to get it right, I
> need to know where to use .IP vs .PP.
>
> I'd happily replace this with the use of ".RS 4/.EX/.EE/.RE", but
> what, if anything do I surround it with? And can I do it in a way that
> I don't need to care whether I'm currently in an indented zone of
> text?
>
> I mean, if I use:
>
> .RS
> .RS 4
> .PP
> .EX
> int
> main(void)
> {
>     printf("Hello world\n");
> }
> .EE
> .PP
> .RE
> .RE
>
> That produces the desired results (4-space indent) if I am currently
> in an indented zone (.TP or .IP). (But it starts to get even more
> horribly verbose, in terms of markup, than what I currently use.)
>
> But if I use that same form in an unindented zone, then <code> is
> massively (12 spaces) indented. Instead, seem to need to say just:
>
> .RS +4
> .PP
> .EX
> int
> main(void)
> {
>     printf("Hello world\n");
> }
> .EE
> .PP
> .RE
>
> What I'd *ideally* like is a solution for indented code blocks that
> (in order or priority):
>
> 1) is not more verbose than the current solution
> 2) uses more idiomatic mark-up than the current solution
> 3) uses exactly the same form, regardless of whether I'm currently in
> an indented region of text.
>
> So far, I don't see such a solution.
>
> Thanks,
>
> Michael
>
> --
> Michael Kerrisk
> Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
> Linux/UNIX System Programming Training: http://man7.org/training/



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux