Subject: Re: bug#13160: 24.3.50; [PATCH] man page completion support beyond man-db

From: Glenn Morris <[email-masked]>
Date: Wed, 12 Dec 2012 14:31:38 -0500

Wolfgang Jenkner wrote:

> In lisp/man.el, completion of man pages and sections depends on parsing
> the output of `man -k'.  As a bonus, this method provides short
> descriptions in the form of tooltips in the *Completions* buffer.

IMO it should just search MANPATH, like bash_completion does.
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10712#11

This is perhaps a separate issue, but would avoid all of this:

> However, the code only handles the `man -k' output format peculiar to
> the man-db package, which, even on GNU/Linux, is not the only one used
> for this purpose.
>
> For example, Slackware seems to use man-1.6g, whose `man -k' output can
> have an additional reference in square brackets between the page name
> and the section, so that man topic completion does work in this case,
> but neither sections nor descriptions are parsed.
>
> The situation is even worse for FreeBSD, where multiple comma-separated
> page names can be shown on the same line (which is arguably against the
> spirit of POSIX man(1p), but that's not quite clear and doesn't help
> much).