# HG changeset patch # User Stefan Monnier # Date 1154527729 0 # Node ID 0fc019770d976a6c467acfca4dce7aac20b0fde9 # Parent ade26f82c36404da2434204d4d686af5fe2f7904 (PC-expand-many-files): Avoid signalling an error when the current directory doesn't exist. Reported by Micha¸«³l Cadilhac. diff -r ade26f82c364 -r 0fc019770d97 lisp/ChangeLog --- a/lisp/ChangeLog Wed Aug 02 09:56:16 2006 +0000 +++ b/lisp/ChangeLog Wed Aug 02 14:08:49 2006 +0000 @@ -1,3 +1,8 @@ +2006-08-02 Stefan Monnier + + * complete.el (PC-expand-many-files): Avoid signalling an error when + the current directory doesn't exist. Reported by Micha,Ak(Bl Cadilhac. + 2006-08-02 Andreas Schwab * bindings.el (mode-line-format): Simplify reference to vc-mode. diff -r ade26f82c364 -r 0fc019770d97 lisp/complete.el --- a/lisp/complete.el Wed Aug 02 09:56:16 2006 +0000 +++ b/lisp/complete.el Wed Aug 02 14:08:49 2006 +0000 @@ -811,6 +811,12 @@ (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