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]

 



At 2020-09-29T22:15:18+0200, Michael Kerrisk (man-pages) wrote:
> Hi Branden,
> 
> I want to circle back to a point you raised...
> If I understand what you are saying, then iif we are at an indented
> level (.TP, .IP), then we can use your idiom:
> 
> .RS
> .RS n
> ...
> .RE
> .RE
> 
> 
> But, this idiom won't work if we're not at an indented level (?).
> In other words, at .PP level we should not use .RS/.RS n/.RE/.RE, 
> right?

Not true.  You can use .RS/.RE "almost everywhere", as topologists say.

> By contrast, ".in +n/.in" works regardless of whether we 
> are at an indented level, right? (I'm not saying this recommend
> the use of .in; I just want to clarify my understanding.)

.RS and .RE are wrappers around .in.  .RS applies a default indentation
if one is not given, and in any case stores the indentation amount in a
register named for the indentation "level" (roughly[2], how many times
you've called .RS since the last .SH or .SS).  That way you can call .RE
without arguments, or as ".RE 2" to say "go back two indentation levels"
without having to track or remember any indentation measurements.

Does this help?  If you can think of any place in groff_man(7) or
groff_man_style(7) I can make this clearer, please tell me.  Until today
the only two "FAQ"s I had in (what is now) the style page dealt with
relative insets.

And you're not alone in misunderstanding .RS/.RE.  My frustration
with it back in August 2017 it is a major part of what sucked me into
the groff project in the first place[1].

Regards,
Branden

[1] I wouldn't try it inside one of the macros that uses an "input
    trap".  I don't think it would occur to most people to even try, so
    I'll save my experiments for _after_ I've sent this mail.  :)
[2] .RS and .RE work like nested parentheses.
[3] https://lists.gnu.org/archive/html/groff/2017-08/msg00028.html

Attachment: signature.asc
Description: PGP signature


[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