diff options
| author | Leo Liu | 2013-07-09 10:47:44 +0800 |
|---|---|---|
| committer | Leo Liu | 2013-07-09 10:47:44 +0800 |
| commit | 5550a72cf26485d312f8cc2c1c6f49b2fbd8f667 (patch) | |
| tree | 7ee76079dc20a7e3838e3e07ba1e305c1e4c1262 | |
| parent | 70c46b281688a5a04097c56e651282a657c38494 (diff) | |
| download | emacs-5550a72cf26485d312f8cc2c1c6f49b2fbd8f667.tar.gz emacs-5550a72cf26485d312f8cc2c1c6f49b2fbd8f667.zip | |
* ido.el (ido-read-directory-name): Handle fallback.
(ido-read-file-name): Update DIR to ido-current-directory.
Fixes: debbugs:1516
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/ido.el | 17 |
2 files changed, 16 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 03b4e4e6519..562f4739f80 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-07-09 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * ido.el (ido-read-directory-name): Handle fallback. | ||
| 4 | (ido-read-file-name): Update DIR to ido-current-directory. | ||
| 5 | (Bug#1516) | ||
| 6 | |||
| 1 | 2013-07-09 Dmitry Gutov <dgutov@yandex.ru> | 7 | 2013-07-09 Dmitry Gutov <dgutov@yandex.ru> |
| 2 | 8 | ||
| 3 | * progmodes/ruby-mode.el (ruby-font-lock-keywords): Remove extra | 9 | * 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." | |||
| 4754 | (eq (get this-command 'ido) 'dir) | 4754 | (eq (get this-command 'ido) 'dir) |
| 4755 | (memq this-command ido-read-file-name-as-directory-commands)) | 4755 | (memq this-command ido-read-file-name-as-directory-commands)) |
| 4756 | (setq filename | 4756 | (setq filename |
| 4757 | (ido-read-directory-name prompt dir default-filename mustmatch initial)) | 4757 | (ido-read-directory-name prompt dir default-filename mustmatch initial))) |
| 4758 | (if (eq ido-exit 'fallback) | ||
| 4759 | (setq filename 'fallback))) | ||
| 4760 | ((and (not (eq (get this-command 'ido) 'ignore)) | 4758 | ((and (not (eq (get this-command 'ido) 'ignore)) |
| 4761 | (not (memq this-command ido-read-file-name-non-ido)) | 4759 | (not (memq this-command ido-read-file-name-non-ido)) |
| 4762 | (or (null predicate) (eq predicate 'file-exists-p))) | 4760 | (or (null predicate) (eq predicate 'file-exists-p))) |
| @@ -4777,6 +4775,7 @@ See `read-file-name' for additional parameters." | |||
| 4777 | (setq ido-exit nil) | 4775 | (setq ido-exit nil) |
| 4778 | (setq filename | 4776 | (setq filename |
| 4779 | (ido-read-internal 'file prompt 'ido-file-history default-filename mustmatch initial)) | 4777 | (ido-read-internal 'file prompt 'ido-file-history default-filename mustmatch initial)) |
| 4778 | (setq dir ido-current-directory) ; See bug#1516. | ||
| 4780 | (cond | 4779 | (cond |
| 4781 | ((eq ido-exit 'fallback) | 4780 | ((eq ido-exit 'fallback) |
| 4782 | (setq filename 'fallback)) | 4781 | (setq filename 'fallback)) |
| @@ -4810,10 +4809,14 @@ See `read-directory-name' for additional parameters." | |||
| 4810 | (ido-work-file-index -1)) | 4809 | (ido-work-file-index -1)) |
| 4811 | (setq filename | 4810 | (setq filename |
| 4812 | (ido-read-internal 'dir prompt 'ido-file-history default-dirname mustmatch initial)) | 4811 | (ido-read-internal 'dir prompt 'ido-file-history default-dirname mustmatch initial)) |
| 4813 | (if filename | 4812 | (cond |
| 4814 | (if (and (stringp filename) (string-equal filename ".")) | 4813 | ((eq ido-exit 'fallback) |
| 4815 | ido-current-directory | 4814 | (let ((read-file-name-function nil)) |
| 4816 | (concat ido-current-directory filename))))) | 4815 | (run-hook-with-args 'ido-before-fallback-functions 'read-directory-name) |
| 4816 | (read-directory-name prompt ido-current-directory | ||
| 4817 | default-dirname mustmatch initial))) | ||
| 4818 | ((equal filename ".") ido-current-directory) | ||
| 4819 | (t (concat ido-current-directory filename))))) | ||
| 4817 | 4820 | ||
| 4818 | ;;;###autoload | 4821 | ;;;###autoload |
| 4819 | (defun ido-completing-read (prompt choices &optional _predicate require-match | 4822 | (defun ido-completing-read (prompt choices &optional _predicate require-match |