From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wolfgang Jenkner Newsgroups: gmane.emacs.bugs Subject: bug#13160: 24.3.50; [PATCH] man page completion support beyond man-db Date: Sun, 23 Dec 2012 20:49:52 +0100 Message-ID: <851uegr1jz.fsf@iznogoud.viz> 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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1356292259 1068 80.91.229.3 (23 Dec 2012 19:50:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Dec 2012 19:50:59 +0000 (UTC) Cc: 13160@debbugs.gnu.org, Kevin Ryde To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Dec 23 20:51:14 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 1TmrZk-0000eV-Pn for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Dec 2012 20:51:08 +0100 Original-Received: from localhost ([::1]:43122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TmrZW-0005kt-K1 for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Dec 2012 14:50:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:36593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TmrZP-0005kQ-6B for bug-gnu-emacs@gnu.org; Sun, 23 Dec 2012 14:50:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TmrZF-0007MU-1V for bug-gnu-emacs@gnu.org; Sun, 23 Dec 2012 14:50:47 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TmrZE-0007MJ-Ug for bug-gnu-emacs@gnu.org; Sun, 23 Dec 2012 14:50:36 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TmrZe-0006L5-AC for bug-gnu-emacs@gnu.org; Sun, 23 Dec 2012 14:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Wolfgang Jenkner Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Dec 2012 19:51: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.135629222924323 (code B ref 13160); Sun, 23 Dec 2012 19:51:02 +0000 Original-Received: (at 13160) by debbugs.gnu.org; 23 Dec 2012 19:50:29 +0000 Original-Received: from localhost ([127.0.0.1]:57068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmrZ5-0006KE-Cp for submit@debbugs.gnu.org; Sun, 23 Dec 2012 14:50:29 -0500 Original-Received: from mx14.lb01.inode.at ([62.99.145.16]:13943 helo=mx.inode.at) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmrZ1-0006K3-TG for 13160@debbugs.gnu.org; Sun, 23 Dec 2012 14:50:25 -0500 Original-Received: from [91.119.206.19] (port=13201 helo=iznogoud.viz) by smartmx-14.inode.at with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1TmrYa-0000uY-RA; Sun, 23 Dec 2012 20:49:56 +0100 Original-Received: from wolfgang by iznogoud.viz with local (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1TmrYW-0000Q8-HA; Sun, 23 Dec 2012 20:49:52 +0100 In-Reply-To: (Stefan Monnier's message of "Sun, 23 Dec 2012 08:46:28 -0500") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (berkeley-unix) 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:68960 Archived-At: On Sun, Dec 23 2012, Stefan Monnier wrote: >>> Does it fix an actual bug? [ Sorry if it does fix a real bug and this >>> was mentioned somewhere in this thread, but I haven't found the time to >>> read all threads as thoroughly as I'd like. ] >> My proposed change log entry indicates that the cache handling is rather >> bogus (complete for "foo" then for "bar" and then for "foo" again and >> "man -k ^foo" will be run again and the result prepended to the cache). > > Oh, indeed. Fixed with the trivial patch below, tho. Well yes, you nuke the old content, whis is what the previous versions of my patches proposed here do as well, but this can hardly be called a useful cache then. >> The main reason, however, is that it eliminates any dependency on the >> particular flavour of `man -k' output, so everything can be done in >> elisp by the new Man-parse-apropos (I indicated that in the change log >> entry, too). > > 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 :-) 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. I can wait with my changes until we've found a better data structure. Wolfgang