From: Chong Yidong Date: Wed, 14 Apr 2010 17:32:50 +0000 (-0400) Subject: * ido.el (ido-file-internal): Fix 2009-12-02 change. X-Git-Tag: emacs-pretest-23.1.96~27 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3808c51fa8259b5d6e4c0966311eab9faa2a03d5;p=emacs.git * ido.el (ido-file-internal): Fix 2009-12-02 change. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2fddcbf1366..7ba138f310d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2010-04-14 Óscar Fuentes + + * ido.el (ido-file-internal): Fix 2009-12-02 change. + 2010-04-14 Christoph (tiny change) * progmodes/grep.el (grep-compute-defaults): Fix handling of host 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))))))