Subject: Bug#3788: `apropos' matches only word-substrings even in page names

From: Ian Jackson <[email-masked]>
Date: Tue, 16 Jul 96 00:30 BST

Package: man
Version: 2.3.10-11

I've been trying to investigate why `man -k pbm', `man -k pnm',
`man -k pnm' &c didn't produce the results I'd expected.

I have come to the conclusion that the search term presented to
apropos is matched against any substring consisting of a whole number
of words in the `description', or against the entire page name at once
(presumably because the name is always considered an entire word).

Observe this in the transcript below.

I think it would be much more useful for `man -k alternatives',
`man -k pnm', `man -k dpkg' and similar incantations to give pages
which contain the search term as any substring of the page name, even
if this isn't a whole `word'.  After all, if you want matching on the
whole page name you can use `whatis' rather than `apropos'.

The existing match-words-only behaviour wrt the description is
probably useful.

I'm (now, after having RTFM) aware that `whatis -w' can be used to
do the search I want, with a suitable search term, but I think that
`apropos' should do this by default.

Thanks,
Ian.

-chiark:~> whatis dpkg
dpkg (8)             - a low-level package manager for Debian GNU/Linux
-chiark:~> man -k dpkg
dpkg (8)             - a low-level package manager for Debian GNU/Linux
-chiark:~> man -k pkg
pkg: nothing appropriate.
-chiark:~> man -k dpk
dpk: nothing appropriate.
-chiark:~> man -k gnu/
gnu/: nothing appropriate.
-chiark:~> man -k GNU/
GNU/: nothing appropriate.
-chiark:~> man -k 'package manager'
dpkg (8)             - a low-level package manager for Debian GNU/Linux
-chiark:~> man -k Debian
dpkg-name (1)        - rename Debian packages to full package names
start-stop-daemon (8) - Debian package installation tool
dchanges (1)         - build changes file for a Debian package
update-alternatives (8) - Debian package installation tool
deb (5)              - Debian GNU/Linux binary package format
dchanges (5)         - debian package changes file 
deb-control (5)      - Debian GNU/Linux packages' master control file format
dpkg (8)             - a low-level package manager for Debian GNU/Linux
dpkg-deb (8)         - Debian package archive (.deb) manipulation tool
deb-old (5)          - Debian GNU/Linux binary package old style format
-chiark:~> man -k 'GNU/Linux'
deb (5)              - Debian GNU/Linux binary package format
deb-control (5)      - Debian GNU/Linux packages' master control file format
dpkg (8)             - a low-level package manager for Debian GNU/Linux
deb-old (5)          - Debian GNU/Linux binary package old style format
-chiark:~> man -k packa
packa: nothing appropriate.
-chiark:~> man -k deb
deb (5)              - Debian GNU/Linux binary package format
dpkg-deb (8)         - Debian package archive (.deb) manipulation tool
-chiark:~> man -k .deb
dpkg-deb (8)         - Debian package archive (.deb) manipulation tool
-chiark:~> man -k alternatives
alternatives: nothing appropriate.
-chiark:~> man -k update-alternatives
update-alternatives (8) - Debian package installation tool
-chiark:~> man -k tool
start-stop-daemon (8) - Debian package installation tool
update-alternatives (8) - Debian package installation tool
installit (1)        - file/directory installation tool
dpkg-deb (8)         - Debian package archive (.deb) manipulation tool
-chiark:~>