From: Ingo Schwarze <schwarze@usta.de>
To: Colin Watson <cjwatson@debian.org>,
Alejandro Colomar <alx.manpages@gmail.com>,
g.branden.robinson@gmail.com
Cc: linux-man@vger.kernel.org, groff@gnu.org
Subject: Re: All caps .TH page title
Date: Fri, 22 Jul 2022 16:44:00 +0200 [thread overview]
Message-ID: <Ytq3sB/coOoikKLJ@asta-kit.de> (raw)
In-Reply-To: <Ytnt4dPmkrPmL1Sh@riva.ucam.org>
Hi,
Colin Watson wrote on Fri, Jul 22, 2022 at 01:22:57AM +0100:
> man-db doesn't index on the .TH section at all, and I don't believe
> I've encountered the practice of doing so in other indexers
> (I could be wrong, but I think that's something I would have
> remembered if I'd noticed it).
FWIW, the mandoc(1) implementation of the indexes uses the following
to derive names for a page:
* the first component of the file name,
including of hard, soft, and .so links
* in man(7) pages, the first argument of the .TH macro <<=====
* in man(7) pages, any words preceding the first "-" or "\-"
in the NAME section
* in mdoc(7) pages, the first argument of the .Dt macro <<=====
* in mdoc(7) pages, arguments of .Nm macros in the NAME section
* in mdoc(7) pages, arguments of .Nm macros in the SYNOPSIS
* in mdoc(7) pages, first arguments of .Fo and .Fn macros in the SYNOPSIS
The last two - mdoc(7) SYNOPSIS content - are only used for man -k
searches explicitly specifying the Nm search key. All others are also
used for plain man(1) name lookup.
In mandoc the following are used as section names:
* if the directory name starts with "man" or "cat", the rest of it
* the file name suffix, starting after the last dot
* in man(7) pages, the second argument of the .TH macro
* in mdoc(7) pages, the second argument of the .Dt macro
The above rules often cause pages to end up with more than on name
and and more than one section. For example, a file called
man3p/strcpy.3
containing
.TH strlcat 3bsd
.SH NAME
wcslcpy, wcslcat \- yadayada
can be found with any of the following commands, and several more:
man 3bsd strcpy
man 3 strlcat
man wcslcat
man 3p wcslcpy
As a special case, if the .TH or .Dt argument agrees with one among
the other names but differs in case, it is not used, because
mandoc assumes the other name is likely correctly cased while
the name in the .TH or .Dt macro may have been converted to all caps.
> man-db's man(1) performs case-insensitive lookups by default, which
> I've found to be more useful behaviour. Case-sensitive lookup can be
> requested using the -I/--match-case option.
In the mandoc implementation, plain man(1) follows the tradition of
being case-sensitive, but i must admit examples of manual pages with
names that differ only in case are hard to find indeed, so it might
make sense to change this and make it agree with man-db.
In the mandoc implementation of apropos(1), searches use case-insensitive
extended regular expressions by default (which originally was a
proposal coming from FreeBSD). If the regular expression operator '~'
is explicitly specified, the search becomes case-sensitive. If the -i
option is given, it becomes case-insensitive again. The substring-search
operator '=' always remains case-insensitive no matter what.
> As far as I know this was an innovation when I introduced it in 2002,
> so I don't know how widespread this behaviour is among man(1)
> implementations. You probably can't rely on it.
>
> But in any case, as above, changing the arguments to .TH doesn't affect
> this. I haven't noticed it being widespread practice to spuriously
> capitalize the name part of lines in the "NAME" section.
Indeed, doing that would be very bad style, not least because it would
make the correct capitalization of the name hard to find for the
human reader of the manual page.
Yours,
Ingo
next prev parent reply other threads:[~2022-07-22 14:44 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-21 14:29 All caps .TH page name Alejandro Colomar
2022-07-21 18:36 ` G. Branden Robinson
2022-07-21 23:16 ` All caps .TH page title Alejandro Colomar
2022-07-22 0:22 ` Colin Watson
2022-07-22 1:34 ` G. Branden Robinson
2022-07-22 4:07 ` G. Branden Robinson
2022-07-22 14:44 ` Ingo Schwarze [this message]
2022-07-22 2:14 ` G. Branden Robinson
2022-07-22 10:35 ` Alejandro Colomar (man-pages)
2022-07-22 11:46 ` Alejandro Colomar
2022-07-22 19:03 ` G. Branden Robinson
2022-07-22 22:20 ` Alejandro Colomar
2022-07-23 19:29 ` Ingo Schwarze
2022-07-24 11:20 ` Alejandro Colomar (man-pages)
2022-07-24 14:57 ` Ingo Schwarze
2022-07-24 15:44 ` G. Branden Robinson
2022-07-24 17:07 ` FHS and packaging (was: All caps .TH page title) Alejandro Colomar
2022-07-27 16:05 ` All caps .TH page title Ingo Schwarze
2022-07-29 11:33 ` man0, man3head (was: All caps .TH page title) Alejandro Colomar
2022-07-29 12:31 ` Ingo Schwarze
2022-07-29 11:43 ` BSD and GPL " Alejandro Colomar
2022-07-24 16:17 ` man -M tcl " Alejandro Colomar
2022-07-27 15:32 ` Ingo Schwarze
2022-07-29 12:03 ` Alejandro Colomar
2022-07-29 13:22 ` Ingo Schwarze
2022-07-29 13:27 ` Alejandro Colomar
2022-07-22 16:19 ` All caps .TH page name Ingo Schwarze
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=Ytq3sB/coOoikKLJ@asta-kit.de \
--to=schwarze@usta.de \
--cc=alx.manpages@gmail.com \
--cc=cjwatson@debian.org \
--cc=g.branden.robinson@gmail.com \
--cc=groff@gnu.org \
--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