summaryrefslogtreecommitdiff
path: root/lisp/ido.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-04-19 11:07:52 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2010-04-19 11:07:52 -0400
commit6e104790e756226cbb5b7feaf01854103ded9f36 (patch)
tree5a1bd758627d6358a7083bb3d72108676bde8bdb /lisp/ido.el
parentb5feea0feaf721c66ff34ee2728c76a4c028fa0f (diff)
parent79d74ac527b79242175bca1b39ef12b1693c3523 (diff)
downloademacs-6e104790e756226cbb5b7feaf01854103ded9f36.tar.gz
Merge from emacs-23
Diffstat (limited to 'lisp/ido.el')
-rw-r--r--lisp/ido.el8
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))))))