Various pages: Use correct letter case in page titles (TH)
Semi-scripted change:
$ find man* -type f \
| xargs grep -L '\.so' \
| while read f; do
P=$(basename $f);
T=$(grep '\.TH ' $f | cut -f2,3 -d' ' | sed 's/ /./');
p=$(echo $P | tr '[:upper:]' '[:lower:]');
t=$(echo $T | tr '[:upper:]' '[:lower:]');
Tn=$(echo $T | sed 's/\.[^.]\+$//')
Pn=$(echo $P | sed 's/\.[^.]\+$//')
N=$(man_section $f NAME \
| sed -n '/NAME/,/ - /p' \
| sed 's/ - .*//' \
| grep -v '^NAME$' \
| tr ', ' '\n' \
| grep -i "^$Pn$" \
| head -n1)
test $P = $T \
&& test -n $N \
&& continue;
if test "x$p" != "x$t"; then
echo 1 $P $T $N;
elif test -z "$N"; then
sed -i "/\.TH /s/$Tn/$Pn/" $f;
fi;
done;
Most of the changes produced by this script needed to be reverted,
but the some of them were good.
On 10/30/22 23:00, G. Branden Robinson wrote:
> For those to whom this change is coming as an unpleasant surprise, the
> forthcoming groff 1.23.0 features an option that will reverse this
> change at rendering time.
>
> From groff_man(7):
>
> -rCT=1 Capitalize titles, setting the man page title (the first
> argument to .TH) in full capitals in headers and footers.
> This transformation is off by default because it discards
> case distinction information.
>
> This register can also be set in a site-local "man.local" file to force
> it on for all pages. On Debian-based systems, this file is in
> /etc/groff. The following line will do the trick.
>
> .nr CT 1
>
> The groff_man_style(7) man page offers further examples of such
> rendering customization.
>
> /usr/local/share/groff/site-tmac/man.local
> Put site‐local changes and customizations into this file.
>
> .\" Use narrower indentation on terminals and similar.
> .if n .nr IN 4n
> .\" Put only one space after the end of a sentence.
> .ss 12 0 \" See groff(7).
> .\" Keep pages narrow even on wide terminals.
> .if n .if \n[LL]>78n .nr LL 78n
> .\" Ensure hyperlinks are enabled for terminals.
> .nr U 1
>
> On multi‐user systems, it is more considerate to users whose
> preferences may differ from the administrator’s to be less
> aggressive with such settings, or to permit their override
> with a user‐specific man.local file. This can be achieved by
> placing one or both of following requests at the end of the
> site‐local file.
> .soquiet \V[XDG_CONFIG_HOME]/man.local
> .soquiet \V[HOME]/.man.local
> However, a security‐sandboxed man(1) program may lack
> permission to open such files.