summaryrefslogtreecommitdiff
path: root/lisp/complete.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2006-08-02 14:08:49 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2006-08-02 14:08:49 +0000
commit424f4c9cfaf7c44e1e4ed1cc21d0d13f7dd59331 (patch)
treed9a96178435e906c4ffadc2abe5cfb1be5d59b23 /lisp/complete.el
parent3862ba195c151ebc6930dbd3b4a9ed3a38e53a48 (diff)
downloademacs-424f4c9cfaf7c44e1e4ed1cc21d0d13f7dd59331.tar.gz
(PC-expand-many-files): Avoid signalling an error when
the current directory doesn't exist. Reported by Michaƫl Cadilhac.
Diffstat (limited to 'lisp/complete.el')
-rw-r--r--lisp/complete.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/complete.el b/lisp/complete.el
index ca6231893c3..c49ad488536 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -811,6 +811,12 @@ or properties are considered."
(defun PC-expand-many-files (name)
(with-current-buffer (generate-new-buffer " *Glob Output*")
(erase-buffer)
+ (when (and (file-name-absolute-p name)
+ (not (file-directory-p default-directory)))
+ ;; If the current working directory doesn't exist `shell-command'
+ ;; signals an error. So if the file names we're looking for don't
+ ;; depend on the working directory, switch to a valid directory first.
+ (setq default-directory "/"))
(shell-command (concat "echo " name) t)
(goto-char (point-min))
;; CSH-style shells were known to output "No match", whereas