From: "G. Branden Robinson" <g.branden.robinson@gmail.com>
To: Alejandro Colomar <alx@kernel.org>
Cc: linux-man@vger.kernel.org, Jason Yundt <jason@jasonyundt.email>,
groff@gnu.org
Subject: Re: [PATCH v1] CONTRIBUTING.d/style/c: Add coding style for the example programs
Date: Sat, 8 Feb 2025 18:45:31 -0600 [thread overview]
Message-ID: <20250209004531.bayfkwan2sr2vncz@illithid> (raw)
In-Reply-To: <sxeh5c2rcyyp7eakkmjsxvdhiugw34ytqe3rqk3khi6mjpuikn@qglzlxykjlvs>
[-- Attachment #1: Type: text/plain, Size: 3415 bytes --]
Hi Alex,
At 2025-02-09T00:59:50+0100, Alejandro Colomar wrote:
> On Sat, Feb 08, 2025 at 05:46:19PM -0600, G. Branden Robinson wrote:
> > _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.
>
> Yes, I'm proposing using tabs exclusively within EX/EE.
>
> > 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.
>
> Are you sure? I'm getting 5 characters per cell, which is what has
> prevented me from doing it more happily. I would have done it already
> if I had seen 8 chars-per-tab.
Good thing I looped in the groff list; this way more people got to see
me make a fool of myself.
You're right. Here's why.
https://git.savannah.gnu.org/cgit/groff.git/tree/tmac/an.tmac?h=1.23.0#n162
My days of furious hacking on the man(7) macro package seem mostly to be
in the past, and I'm spending much more time on GNU troff itself of
late. So I insensibly crafted a demonstrator for the formatter's own
behavior, not incorporating that of the macro package.
> Why am I not seeing 8-char indents?
Because the package redefines the tab stops.
This rears the head of the portability beast a bit higher.
Famous Original Doug's man(7) in Seventh Edition Unix also set the tab
stops at every half-inch.
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/lib/tmac/tmac.an
So does Heirloom Doctools. So does mandoc(1).
Neatroff doesn't ship its own man(7) implementation, and Plan 9 and
Solaris 10 troffs, and whatever other System V troffs still exist,
I'll wager have no relevance to the Linux man-pages project.
Fortunately grotty(1)'s different idea of how wide a tab stop is doesn't
pose a problem. It renders a page as a rectangular grid of character
cells, populates those cells where the formatter (which knows the
document's tab stops) tells it to, then, if it's been given the `-h`
option, it uses 8-column tab stops to optimize output. But, provided
the Unix terminal driver's tab stops are also configured to every 8
columns,[1] this causes no alteration of the output.
This works out okay because there's no such thing as a "tab stop" in the
formatter's page description language.
This half-inch tab stop default would seem to foreclose the possibility
of using hard tabs for code examples in your man page sources, unless
you want to depart from Ingo's and my man(7) portability advice
regarding the use of formatter requests.
Regards,
Branden
[1] ...which is almost always true, and while traditionally this was
configurable on Unix systems,[2] it's possible that userland and/or
terminal driver support has bitrotted to nonfunctionality on
Linux-based systems, or was never implemented in the first place.
See subsection "Tabs and Initialization" of terminfo(5).
[2] ...because of the long shadow cast by typewriters (the original Unix
terminal devices) and the corresponding more "manual" and
labor-intensive table composition procedures they required.
Similarly, newspaper-style page composition with "cut" and "paste"
operations involving scissors and adhesive are fading from memory--
as is the Aldus PageMaker product that largely killed the practice.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2025-02-09 0:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-08 22:44 [PATCH v1] CONTRIBUTING.d/style/c: Add coding style for the example programs Alejandro Colomar
2025-02-08 22:57 ` Alejandro Colomar
2025-02-08 23:46 ` G. Branden Robinson
2025-02-08 23:59 ` Alejandro Colomar
2025-02-09 0:45 ` G. Branden Robinson [this message]
2025-02-09 9:45 ` Alejandro Colomar
2025-02-09 2:20 ` onf
2025-02-17 20:24 ` Günther Noack
2025-02-17 22:16 ` Alejandro Colomar
2025-02-17 22:35 ` G. Branden Robinson
2025-02-17 23:03 ` Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250209004531.bayfkwan2sr2vncz@illithid \
--to=g.branden.robinson@gmail.com \
--cc=alx@kernel.org \
--cc=groff@gnu.org \
--cc=jason@jasonyundt.email \
--cc=linux-man@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox