(PC-expand-many-files): Avoid signalling an error when

the current directory doesn't exist.  Reported by Michaël Cadilhac.
This commit is contained in:
Stefan Monnier
2006-08-02 14:08:49 +00:00
parent 3862ba195c
commit 424f4c9cfa
2 changed files with 11 additions and 0 deletions

View 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,Ak(Bl Cadilhac.
2006-08-02 Andreas Schwab <schwab@suse.de>
* bindings.el (mode-line-format): Simplify reference to vc-mode.

View 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