all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Wolfgang Jenkner <wjenkner@inode.at>
Cc: 13160@debbugs.gnu.org, Kevin Ryde <user42@zip.com.au>
Subject: bug#13160: 24.3.50; [PATCH] man page completion support beyond man-db
Date: Sun, 23 Dec 2012 20:20:53 -0500	[thread overview]
Message-ID: <jwvsj6wfegb.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <851uegr1jz.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Sun, 23 Dec 2012 20:49:52 +0100")

[ Second part of my reply, sorry I had to leave in a hurry.  ]

>> That indeed the part of the change log I did not understand.  How does
>> the "man -k" argument relate to the "output flavor"?
> Well, I wrote in the proposed change log:
> 	Conveniently, the change entails that we don't have to guess the
> 	output format of `man -k' in order to pass it a useful regexp.
> The problem is that the page names are not necessarily anchored at the
> beginning of a summary line (there are examples in the proposed
> man-tests.el), so we can't always use "man -k ^foo" to find all summary
> lines for man page names starting with "foo".  A previous version of the
> patch posted here introduced a new variable holding a suitable regexp
> `anchor', which, however, would depend on the output format of `man -k',
> its flavour :-)

Oh, so you're saying that the regexp passed to "man -k" is matched not
against plain command names, but against lines of the same shape as the
output of "man -k"?  IOW, "man -k RE" is barely more than "man -k ^ |
grep RE"? Oh, yes, I see that now, indeed (I guess I did know that
a some point, but it doesn't even ring a remote bell).

> I think that parsing the full listing obtained with `man -k ^' is the
> best solution, it's just that storing the result in a plain list is not
> quite optimal, hence my babbling about tries.

The problem is not only the lookup time (which is usually small enough
not to be a problem), but the actual memory use (which slows down GC
among other things).  My earlier estimate was very optimistic since it
didn't take into account the `help-echo' text-property, which more than
doubles the size.

The easiest is probably to keep the current structure and just drop the
^ if the string is non-empty (we'll get lots more false-positives than
with the ^, but we still gain: even for some single letters, like
"man -k b", we get less than half as much data as "man -k ^").


        Stefan





  parent reply	other threads:[~2012-12-24  1:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12 19:16 bug#13160: 24.3.50; [PATCH] man page completion support beyond man-db Wolfgang Jenkner
2012-12-12 19:31 ` Glenn Morris
2012-12-12 20:30   ` Stefan Monnier
2012-12-14 21:19 ` Kevin Ryde
2012-12-14 21:35   ` Wolfgang Jenkner
2012-12-15  0:59     ` Kevin Ryde
2012-12-16 18:07       ` Wolfgang Jenkner
2012-12-22 15:27         ` Wolfgang Jenkner
2012-12-22 17:11           ` Stefan Monnier
2012-12-22 17:58             ` Wolfgang Jenkner
2012-12-23 13:46               ` Stefan Monnier
2012-12-23 19:49                 ` Wolfgang Jenkner
2012-12-23 20:59                   ` Wolfgang Jenkner
2012-12-24  0:00                   ` Stefan Monnier
2013-01-06 19:27                     ` Wolfgang Jenkner
2012-12-24  1:20                   ` Stefan Monnier [this message]
2012-12-24  2:23                     ` Wolfgang Jenkner
2012-12-24  4:34                       ` Stefan Monnier
2013-01-06 19:48                         ` Wolfgang Jenkner
2013-01-10 15:01                           ` Stefan Monnier
2012-12-30  0:10                     ` Kevin Ryde
2012-12-23  0:16           ` Kevin Ryde

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=jwvsj6wfegb.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=13160@debbugs.gnu.org \
    --cc=user42@zip.com.au \
    --cc=wjenkner@inode.at \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.