[looping in groff list because I bring up grotty *roff details] (in both senses of "grotty"!) Hi Alex, At 2025-02-08T23:57:07+0100, Alejandro Colomar wrote: > On Sat, Feb 08, 2025 at 11:44:43PM +0100, Alejandro Colomar wrote: > > Personally, I prefer tabs for actual programming. But for manual > > pages, we can live with 4 spaces for $reasons. > > > > [...] > > > +Description > > + Indentation > > + Use 4 spaces. Ideally, tabs would be preferred; however, they > > + cause 5 spaces in manual pages, which is weird, so we use 4 > > + spaces. > > On a side note, Branden, I've considered changing the manual pages' > EXAMPLES' source code to use tabs, and let the formatter do whatever > it wants. Do you have any opinion on that? The behavior of input tab characters is well-defined in *roff, but defined _weirdly_ to most people's sensibilities when filling is enabled. I won't quote the documentation here, merely point to it. https://www.gnu.org/software/groff/manual/groff.html.node/Tabs-and-Leaders.html (This discussion is somewhat elaborated for clarity in the forthcoming groff 1.24.) _If_ you advise the use of tab characters _only_ when filling is disabled, as, apropos of the Subject line, is the case in (displayed) code examples, you should be fine. However, you will get 8 character cells per tab stop and I am _not_ sure it's portable to expect, or to try to configure, anything else. For example, grotty(1) has the `-h` option, which is accessible via the MANROFFOPT environment variable supported by man-db man(1). -h Use literal horizontal tab characters in the output. Tabs are assumed to be set every 8 columns. Hmm, I should edit this to add "to optimize movement to the next tab stop" or similar language. In other words, when given this option, grotty(1) performs a crude curses-style optimization, replacing long sequences of spaces with tabs even where tabs do not appear in the input. For example: $ printf 'foo\tbar baz' | nroff | od -c 0000000 f o o b a r 0000020 b a z \n \n \n \n \n \n \n \n 0000040 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n * 0000120 \n \n \n \n \n \n \n \n \n \n 0000132 $ printf 'foo\tbar baz' | nroff -P-h | od -c 0000000 f o o \t b a r \t b a z 0000020 \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n * 0000120 \n \n 0000122 Finally, I have a vague memory--perhaps not a correct one--that Michael Kerrisk preferred 4-cell tab stops over 8-cell ones (however obtained) because he found that the latter caused lines to overrun too frequently. Keep in mind that displayed code examples in man pages will always be significantly indented, unlike in real C source where we start everything at column 0. Things to consider. I would proceed with caution, and test with multiple formatters. (Maybe you already do.) Regards, Branden
Attachment:
signature.asc
Description: PGP signature