Re: [PATCH 08/42] doc: improve formatting of command synopses (1/2)

"G. Branden Robinson" <[email protected]> Tue, 30 Dec 2025 17:47:41 -0600
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <20251230234741.nbc3cvms42fwt3j3@illithid>
Hi Bernhard,

At 2025-12-28T23:42:27+0100, Bernhard Voelker wrote:
> > Should we replace .HP by a simple .P?
> > Or better just remove it?
> 
> According to groff_man_style(7), the better replacement seems to be
> .TP,

What language in that man page is leading you to that conclusion?
There's a good chance the wording is mine,[1] and I should revise it to
foreclose an avenue for confusion.

> which also caters better for the hanging indentation of the lines
> following ...

I think that's coincidental, and with a shorter or longer command name
you'd be less satisfied with the result.

Example:
$ printf '.TH foo 1 2025-12-30 "groff test suite"\n.TP\n.B ls\n.RB [ \\-1aAbBcCdDfFgGhHiklLmnNoqQrRsStuUvxXZ ]\n' \
    | ~/groff-1.23.0/bin/nroff -rLL=72n -man
foo(1)                   General Commands Manual                  foo(1)

       ls     [-1aAbBcCdDfFgGhHiklLmnNoqQrRsStuUvxXZ]

groff test suite               2025‐12‐30                         foo(1)

Conversely, if the tag name is lengthy, the line breaks after the tag,
which doesn't resemble a "hanging paragraph" at all.

$ printf '.TH foo 1 2025-12-30 "groff test suite"\n.TP\n.B really\\-long\\-command\\-name\n.RB [ \\-1aAbBcCdDfFgGhHiklLmnNoqQrRsStuUvxXZ ]\n' \
    | ~/groff-1.23.0/bin/nroff -rLL=72n -man
foo(1)                   General Commands Manual                  foo(1)

       really-long-command-name
              [-1aAbBcCdDfFgGhHiklLmnNoqQrRsStuUvxXZ]

groff test suite               2025‐12‐30                         foo(1)

(One _can_ specify the indentation that a `TP` paragraph uses, but this
can be tedious to maintain,[2] so neither I nor mandoc(1) maintainer
Ingo Schwarze recommend it.)

I also think that Eric Raymond proclaimed the deprecation of the `HP`
macro without sufficiently thinking through use cases, and/or announced
it premised on an overestimate of how swiftly the world would rush to
adopt groff's `SY` and `YS` extensions to man(7).  (I can't find any
evidence that this deprecation was discussed on the groff@gnu list.)

> >     an.tmac:./locate.1:18: style: use of deprecated macro: .HP
> >     make[3]: *** [Makefile:3287: findutils-check-manpages] Error 1
> >     make[3]: Target 'check-local' not remade because of errors.
> 
> ... which matters at least here in locate.1.

I understand not wanting to go to the trouble of working around this
deprecation warning, especially since it will go away on its own in
groff 1.24.0 anyway.

Maybe the best path is to use `TP` for now, then switch to `HP` (or
page-locally defined `SY` and `YS`) in the future when you feel groff
1.24 has sufficiently supplanted 1.23 in deployed systems of interest to
the findutils project.

Thoughts?

Regards,
Branden

[1] https://cgit.git.savannah.gnu.org/cgit/groff.git/log/tmac/groff_man.7.man.in?h=1.23.0

[2] I can't find it right now, I had an exchange with Alex Colomar,
    Linux man-pages project maintainer, on this topic some years ago.
    In so doing I managed to dream up a sequence of text layout
    problems, solutions, and further problems that may have resembled
    those that drove Mike Lesk's development of the tbl(1) preprocessor
    at the Bell Labs CSRC.
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmlUZJUACgkQ0Z6cfXEm
bc5Oxg/+KZRNK463rYjfc7zg6vTwYhfxF1kgLDlAUb0Qo1UKSmfYzCkAPyzmZIFK
Tzo6wWzVYFci3yr1fCPpo4aJXzPBWqPpVpw74gmYrc7MkoFbejnORSOi8854WcUK
PC3Zl3M/Fb0mL/WHiKxZtgw4k06ALZkFdj1lMBWfJ/IXO/Me7JFiolDqRm+37wX+
F7KBdIgQeTUSYn1PjefwkSufcVO9zxooryZ7cjk7SPbzoefCajtGJxjraNf3QOAV
yb7nahhbQEvz3Me5s6s/KV7MvWG+4A1gAB/yOTFvaOCUHCoNaykYTL58Z5aNdE07
ngaechxY0eG66abqtHDjoS1AzcwjCsfMhwS1fUXMQahTpc99HXgWsWSnAWqbCLqf
HgA8VqAtILx/KdfMV6e7vW1u3jKJkjusIKQlruHjPYSYFHoy3pwwwvB83gU27s8B
Dm+pPiNF5Fd3r2eztTsR9EXmc3EvbxU42V91IN33s9lsLFbDNbH3MRPOVbi+Bwwc
mV/XQPGS2dM7+5w9jpEixsuUJbQJfFoj/Dgd5Dy7set+ZzwRIuuXw/MH70c6mSrA
veFfSWCdfBMCuoXtc901h7GZWp2Kve13KwO6ByX6lKSu79DpsPdBiXvLhph7Nunt
6Ue5NthnQpfOqU63dHU9nYpkP1+qXT4CyxbqZJlolkzHws6nm8o=
=rCKe
-----END PGP SIGNATURE-----