GNU bug report logs - #3717
M-x man completion

Previous Next

Package: emacs;

Reported by: jidanni <at> jidanni.org

Date: Mon, 29 Jun 2009 20:55:04 UTC

Severity: wishlist

Merged with 4056

Found in version 1:20100118-1

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #42 received at 3717 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Kevin Ryde <user42 <at> zip.com.au>
To: Juri Linkov <juri <at> jurta.org>
Cc: monnier <at> iro.umontreal.ca, jidanni <at> jidanni.org,
        3717 <at> debbugs.gnu.org
Subject: Re: bug#3717: M-x man completion
Date: Wed, 25 Nov 2009 09:58:09 +1100
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> jurta.org> 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  <user42 <at> zip.com.au>

	* 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.

[man.el.no-truncate.diff (text/x-diff, inline)]
--- 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)))

This bug report was last modified 15 years and 108 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.