diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2010-04-14 13:32:50 -0400 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2010-04-14 13:32:50 -0400 |
commit | 3808c51fa8259b5d6e4c0966311eab9faa2a03d5 (patch) | |
tree | b47926a817916b8f4adfcd51678ab2179715c632 /lisp/ido.el | |
parent | 7860d2e357cbb9347b5843dd1701b6fa3650d2a0 (diff) | |
download | emacs-3808c51fa8259b5d6e4c0966311eab9faa2a03d5.tar.gz |
* ido.el (ido-file-internal): Fix 2009-12-02 change.
Diffstat (limited to 'lisp/ido.el')
-rw-r--r-- | lisp/ido.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/ido.el b/lisp/ido.el index 48acc50581d..6cedccb3787 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -2272,7 +2272,8 @@ If cursor is not at the end of the user input, move to end of input." (or ido-use-url-at-point ido-use-filename-at-point)) (let (fn d) (require 'ffap) - ;; Duplicate code from ffap-guesser as we want different behavior for files and URLs. + ;; Duplicate code from ffap-guesser as we want different + ;; behavior for files and URLs. (cond ((with-no-warnings (and ido-use-url-at-point @@ -2288,7 +2289,10 @@ If cursor is not at the end of the user input, move to end of input." (ffap-guesser) (ffap-string-at-point)))) (not (string-match "^http:/" fn)) - (setq d (file-name-directory (expand-file-name fn))) + (let ((absolute-fn (expand-file-name fn))) + (setq d (if (file-directory-p absolute-fn) + (file-name-as-directory absolute-fn) + (file-name-directory absolute-fn)))) (file-directory-p d)) (setq ido-current-directory d) (setq initial (file-name-nondirectory fn)))))) |