From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.emacs.bugs Subject: bug#3717: M-x man completion Date: Wed, 25 Nov 2009 09:58:09 +1100 Message-ID: <87k4xf4jjy.fsf@blah.blah> References: <87bpo6p3de.fsf@turtle.gmx.de> <87ab3pfqj0.fsf@jidanni.org> <87ocmsqa7z.fsf@mail.jurta.org> Reply-To: Kevin Ryde , 3717@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1259104111 31456 80.91.229.12 (24 Nov 2009 23:08:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Nov 2009 23:08:31 +0000 (UTC) Cc: 3717@emacsbugs.donarmstrong.com, jidanni@jidanni.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 25 00:08:23 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ND4Uf-0007qR-Cd for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Nov 2009 00:08:22 +0100 Original-Received: from localhost ([127.0.0.1]:35481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ND4Ue-00042F-Kt for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Nov 2009 18:08:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ND4Tp-0003eI-Lh for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2009 18:07:29 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ND4Tl-0003bh-C5 for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2009 18:07:29 -0500 Original-Received: from [199.232.76.173] (port=35154 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ND4Tl-0003bc-7t for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2009 18:07:25 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:60210) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ND4Tk-0002XI-LG for bug-gnu-emacs@gnu.org; Tue, 24 Nov 2009 18:07:25 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAON7M2l002043; Tue, 24 Nov 2009 15:07:22 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nAON568T001215; Tue, 24 Nov 2009 15:05:06 -0800 Resent-Date: Tue, 24 Nov 2009 15:05:06 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kevin Ryde Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Tue, 24 Nov 2009 23:05:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3717 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3717-submit@emacsbugs.donarmstrong.com id=B3717.1259103650920 (code B ref 3717); Tue, 24 Nov 2009 23:05:06 +0000 Original-Received: (at 3717) by emacsbugs.donarmstrong.com; 24 Nov 2009 23:00:50 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mailout1.pacific.net.au (mailout1-1.pacific.net.au [61.8.2.208]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAON0m8J000917 for <3717@emacsbugs.donarmstrong.com>; Tue, 24 Nov 2009 15:00:49 -0800 Original-Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id 7C0FF510BAE; Wed, 25 Nov 2009 10:00:46 +1100 (EST) Original-Received: from blah.blah (ppp291C.dyn.pacific.net.au [61.8.41.28]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 4494227451; Wed, 25 Nov 2009 10:00:45 +1100 (EST) Original-Received: from gg by blah.blah with local (Exim 4.69) (envelope-from ) id 1ND4Kn-0000rv-Fe; Wed, 25 Nov 2009 09:58:09 +1100 In-Reply-To: <87ocmsqa7z.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 24 Nov 2009 19:11:32 +0200") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Tue, 24 Nov 2009 18:07:29 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:32895 Archived-At: --=-=-= Juri Linkov writes: > > man-completion.el are the cache for `man -k' It's pretty vital for me, since man -k is about 1 to 2 seconds per run, which is too slow if you hit tab a few times (twice each to see the completion list). > handling same names in different sections. It's been through a few goes at making it friendly for both page names and file names and stuff. :-) > Also part of man-completion.el deals with man-completion-at-point > that returns a man page name as a string found at point. That's another been though loosening and tightening. I quite like what I got to for line-break hyphenations. I looked last week at Man-hyphenated-reference-regexp and wondered if it was the same thing, but the docstring of Man-possibly-hyphenated-word about returning the previous line's word like "tcgetp-" suggested not. If it is the same then a U+2010 hyphen could be worked in there -- it comes out of recent groff "-Tutf8". If nothing else then give the following bit a go. man-db truncates page names longer than about half the screen width. (Long names arise from perl classes.) 2009-11-24 Kevin Ryde * man.el (Man-completion-table): default-directory "/" in case doesn't otherwise exist. process-environment COLUMNS=999 so as not to truncate long names. process-connection-type pipe to avoid any chance of hitting the pseudo-tty TIOCGWINSZ. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=man.el.no-truncate.diff --- man.el.~1.187.~ 2009-11-25 09:08:03.000000000 +1100 +++ man.el 2009-11-25 09:26:02.000000000 +1100 @@ -754,13 +754,17 @@ ((memq action '(t nil)) (let ((table '())) (with-temp-buffer + (setq default-directory "/") ;; in case inherited doesn't exist ;; Actually for my `man' the arg is a regexp. Don't know how ;; standard that is. Also, it's not clear what kind of ;; regexp are accepted: under GNU/Linux it seems it's ERE-style, ;; whereas under MacOSX it seems to be BRE-style and ;; doesn't accept backslashes at all. Let's not bother to ;; quote anything. - (call-process "man" nil '(t nil) nil "-k" (concat "^" string)) + (let ((process-connection-type nil) ;; pipe + (process-environment (copy-sequence process-environment))) + (setenv "COLUMNS" "999") ;; don't truncate long names + (call-process "man" nil '(t nil) nil "-k" (concat "^" string))) (goto-char (point-min)) (while (re-search-forward "^[^ \t\n]+" nil t) (push (match-string 0) table))) --=-=-=--