From: Leo Liu Date: Tue, 9 Jul 2013 02:47:44 +0000 (+0800) Subject: * ido.el (ido-read-directory-name): Handle fallback. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1879 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5550a72cf26485d312f8cc2c1c6f49b2fbd8f667;p=emacs.git * ido.el (ido-read-directory-name): Handle fallback. (ido-read-file-name): Update DIR to ido-current-directory. Fixes: debbugs:1516 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 03b4e4e6519..562f4739f80 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-07-09 Leo Liu + + * ido.el (ido-read-directory-name): Handle fallback. + (ido-read-file-name): Update DIR to ido-current-directory. + (Bug#1516) + 2013-07-09 Dmitry Gutov * progmodes/ruby-mode.el (ruby-font-lock-keywords): Remove extra diff --git a/lisp/ido.el b/lisp/ido.el index f695ec117f1..12af1952cce 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -4754,9 +4754,7 @@ See `read-file-name' for additional parameters." (eq (get this-command 'ido) 'dir) (memq this-command ido-read-file-name-as-directory-commands)) (setq filename - (ido-read-directory-name prompt dir default-filename mustmatch initial)) - (if (eq ido-exit 'fallback) - (setq filename 'fallback))) + (ido-read-directory-name prompt dir default-filename mustmatch initial))) ((and (not (eq (get this-command 'ido) 'ignore)) (not (memq this-command ido-read-file-name-non-ido)) (or (null predicate) (eq predicate 'file-exists-p))) @@ -4777,6 +4775,7 @@ See `read-file-name' for additional parameters." (setq ido-exit nil) (setq filename (ido-read-internal 'file prompt 'ido-file-history default-filename mustmatch initial)) + (setq dir ido-current-directory) ; See bug#1516. (cond ((eq ido-exit 'fallback) (setq filename 'fallback)) @@ -4810,10 +4809,14 @@ See `read-directory-name' for additional parameters." (ido-work-file-index -1)) (setq filename (ido-read-internal 'dir prompt 'ido-file-history default-dirname mustmatch initial)) - (if filename - (if (and (stringp filename) (string-equal filename ".")) - ido-current-directory - (concat ido-current-directory filename))))) + (cond + ((eq ido-exit 'fallback) + (let ((read-file-name-function nil)) + (run-hook-with-args 'ido-before-fallback-functions 'read-directory-name) + (read-directory-name prompt ido-current-directory + default-dirname mustmatch initial))) + ((equal filename ".") ido-current-directory) + (t (concat ido-current-directory filename))))) ;;;###autoload (defun ido-completing-read (prompt choices &optional _predicate require-match