diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-04-19 11:07:52 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2010-04-19 11:07:52 -0400 |
commit | 6e104790e756226cbb5b7feaf01854103ded9f36 (patch) | |
tree | 5a1bd758627d6358a7083bb3d72108676bde8bdb /lisp/ido.el | |
parent | b5feea0feaf721c66ff34ee2728c76a4c028fa0f (diff) | |
parent | 79d74ac527b79242175bca1b39ef12b1693c3523 (diff) | |
download | emacs-6e104790e756226cbb5b7feaf01854103ded9f36.tar.gz |
Merge from emacs-23
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 ebfcbd4da88..57aa7d4a723 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -2312,7 +2312,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 @@ -2328,7 +2329,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)))))) |