]> git.eshelyaron.com Git - emacs.git/commitdiff
(PC-expand-many-files): Avoid signalling an error when
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 2 Aug 2006 14:08:49 +0000 (14:08 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 2 Aug 2006 14:08:49 +0000 (14:08 +0000)
the current directory doesn't exist.  Reported by MichaĆ«l Cadilhac.

lisp/ChangeLog
lisp/complete.el

index 9e028970a003e6521accec170bdabfc4257fecb3..a8d70ba561991c6a47370dc8f0fa11531433334a 100644 (file)
@@ -1,3 +1,8 @@
+2006-08-02  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * complete.el (PC-expand-many-files): Avoid signalling an error when
+       the current directory doesn't exist.  Reported by Micha\e,Ak\e(Bl Cadilhac.
+
 2006-08-02  Andreas Schwab  <schwab@suse.de>
 
        * bindings.el (mode-line-format): Simplify reference to vc-mode.
index ca6231893c3b9e61bdf201c2cc7f6798658b6dd2..c49ad488536bbf79fea16f78e9bea0f20521bac0 100644 (file)
@@ -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