changeset 106246:ea305afedc95

* 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. (Further to Bug#3717.)
author Kevin Ryde <user42@zip.com.au>
date Wed, 25 Nov 2009 22:41:06 +0000
parents efd193fda91a
children 6f850f541818
files lisp/man.el
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/man.el	Wed Nov 25 21:16:58 2009 +0000
+++ b/lisp/man.el	Wed Nov 25 22:41:06 2009 +0000
@@ -761,14 +761,18 @@
       (unless (and Man-completion-cache
                    (string-prefix-p (car Man-completion-cache) string))
       (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.
+ 	(let ((process-connection-type nil) ;; pipe
+	      (process-environment (copy-sequence process-environment)))
+	  (setenv "COLUMNS" "999") ;; don't truncate long names
           (call-process manual-program nil '(t nil) nil
-                        "-k" (concat "^" string))
+                        "-k" (concat "^" string)))
         (goto-char (point-min))
         (while (re-search-forward "^[^ \t\n]+\\(?: (.+?)\\)?" nil t)
           (push (match-string 0) table)))