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

From: Kevin Ryde <[email-masked]>
Date: Sun, 23 Dec 2012 11:16:07 +1100

Wolfgang Jenkner <[email-masked]> writes:
>
> So let's just cache all entries at the first completion attempt.

I do that for speed and because I have some pagename-at-point stuff
which tries some prefix/suffix combinations to make a good guess.
Holding everything uses up a fair amount of memory but I never came up
with anything better.  I only keep the description part of each name if
needed for completing-help.el or icicles.  I suppose turfing the cache
after a timer could reclaim memory.

For the cache I also watch /var/cache/man/index.db (configurable) for
mtime changes indicating newly installed programs.  If like me you
download and install to have a look at something then new pagenames
happen quite often and an automatic reload is good.

With man-db the index.db is a gdbm or whatever database of course.
I suppose direct access would be both much less ram and faster, but I
don't think man-db advertises it for external use.  I never worked out
why running man -k isn't already faster than it seems to be -- just the
quantity of data being churned by it and then by emacs I suppose.

-- 
Walk without rhythm and it won't attract the worm.