From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#13160: 24.3.50; [PATCH] man page completion support beyond man-db Date: Sun, 23 Dec 2012 20:20:53 -0500 Message-ID: References: <856247krc6.fsf@iznogoud.viz> <87sj78fi0w.fsf@blah.blah> <85ip84qpu8.fsf@iznogoud.viz> <87ehisf7vp.fsf@blah.blah> <8562416f6d.fsf@iznogoud.viz> <8538yyt7z8.fsf@iznogoud.viz> <85txrermss.fsf@iznogoud.viz> <851uegr1jz.fsf@iznogoud.viz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1356312098 10636 80.91.229.3 (24 Dec 2012 01:21:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 24 Dec 2012 01:21:38 +0000 (UTC) Cc: 13160@debbugs.gnu.org, Kevin Ryde To: Wolfgang Jenkner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Dec 24 02:21:53 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tmwjp-0008P0-6r for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Dec 2012 02:21:53 +0100 Original-Received: from localhost ([::1]:33534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tmwjb-00014Y-54 for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Dec 2012 20:21:39 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:43248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TmwjY-00014G-4q for bug-gnu-emacs@gnu.org; Sun, 23 Dec 2012 20:21:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TmwjW-00044z-Uw for bug-gnu-emacs@gnu.org; Sun, 23 Dec 2012 20:21:36 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46952) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TmwjW-00044v-Rp for bug-gnu-emacs@gnu.org; Sun, 23 Dec 2012 20:21:34 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tmwjy-0007aC-6U for bug-gnu-emacs@gnu.org; Sun, 23 Dec 2012 20:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Dec 2012 01:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13160 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 13160-submit@debbugs.gnu.org id=B13160.135631208429090 (code B ref 13160); Mon, 24 Dec 2012 01:22:02 +0000 Original-Received: (at 13160) by debbugs.gnu.org; 24 Dec 2012 01:21:24 +0000 Original-Received: from localhost ([127.0.0.1]:57203 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmwjM-0007Z9-Al for submit@debbugs.gnu.org; Sun, 23 Dec 2012 20:21:24 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:30710) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmwjK-0007Z2-Mu for 13160@debbugs.gnu.org; Sun, 23 Dec 2012 20:21:22 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai4FAG6Zu09FxLDj/2dsb2JhbABEsEiDSYEIghUBAQQBVhYKAwULCw4fBxIUGA0kLoduBboJjRqDKgOIQppxgViDBw X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="210617559" Original-Received: from 69-196-176-227.dsl.teksavvy.com (HELO pastel.home) ([69.196.176.227]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 23 Dec 2012 20:20:54 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 1E51159067; Sun, 23 Dec 2012 20:20:54 -0500 (EST) In-Reply-To: <851uegr1jz.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Sun, 23 Dec 2012 20:49:52 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:68970 Archived-At: [ 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