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: Sat, 22 Dec 2012 12:11:44 -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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1356196375 2830 80.91.229.3 (22 Dec 2012 17:12:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 22 Dec 2012 17:12:55 +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 Sat Dec 22 18:13:10 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 1TmSdJ-0008Gz-5v for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Dec 2012 18:13:09 +0100 Original-Received: from localhost ([::1]:47359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TmSd5-0005tD-7n for geb-bug-gnu-emacs@m.gmane.org; Sat, 22 Dec 2012 12:12:55 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:53343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TmScw-0005t5-QZ for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2012 12:12:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TmScs-0005xu-NS for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2012 12:12:46 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45483) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TmScs-0005xp-Jr for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2012 12:12:42 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TmSdC-0006Bb-EX for bug-gnu-emacs@gnu.org; Sat, 22 Dec 2012 12:13: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: Sat, 22 Dec 2012 17:13: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.135619632823710 (code B ref 13160); Sat, 22 Dec 2012 17:13:02 +0000 Original-Received: (at 13160) by debbugs.gnu.org; 22 Dec 2012 17:12:08 +0000 Original-Received: from localhost ([127.0.0.1]:55734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmScJ-0006AM-HI for submit@debbugs.gnu.org; Sat, 22 Dec 2012 12:12:07 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:6730) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TmScH-0006AG-Kb for 13160@debbugs.gnu.org; Sat, 22 Dec 2012 12:12:06 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09FxLDj/2dsb2JhbABEsEiDSYEIghUBAQQBViMFCwsOJhIUGA0kiBwFugmQRAOIQppxgViDBw X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="210564627" 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; 22 Dec 2012 12:11:45 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id D155658EA5; Sat, 22 Dec 2012 12:11:44 -0500 (EST) In-Reply-To: <8538yyt7z8.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Sat, 22 Dec 2012 16:27:36 +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:68913 Archived-At: >>>> It's not used for parsing, it's only prepended to the search string >>>> passed to `man -k'. >>> Ah. I even had a note in my bit about that. Yes. Daniel Pittman I >>> think it was reported that on macos man -k '' empty string gives no >>> output, hence "^". >> Right, the empty string deserves special attention, also because it has >> the potential to mess up the cache. Thanks for reminding me of this. > Actually, I think the cache is really the clue here: prepending > completions piecemeal to the cache makes only sense if the user > consciously avoids completing the empty string because of memory > constraints... and even then the cache would have to be a trie or > something to be useful. I don't consciously avoid it, but I just never hit TAB to complete a manpage name without first typing a few chars. I doubt I'm the only one. On my system "make -k ^" returns about 9K commands of average length 14chars, so that's about 9K * (16B (chars) + 16B (string object) + 2*8B (cons cells)) or more than 400KB (on a 32bit system) or 700KB (on a 64bit system) for that cache. I'm not sure it's such a good idea. 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. ] > Support man page completion for more man programs. (Bug#13160) > * man.el (Man-parse-apropos): New function. > (Man-completion-table): Use it in parsing `man -k' output to > replace code peculiar to man-db. > Thanks to Kevin Ryde for commenting on a previous version of this. This part of the patch looks OK, feel free to install it. > * automated/man-tests.el: New file. And that as well, of course. Stefan