[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Correct ido behavior?

From: Óscar Fuentes
Subject: Re: Correct ido behavior?
Date: Sat, 27 Feb 2010 17:05:43 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux)

Timo Myyra <address@hidden> writes:

> I'm using the Emacs from Bzr and I wonder if following is the normal
> ido behavior.
> When I enable the "ido-use-filename-at-point" and use find-file it
> works just fine if theres a file name at cursor.  But if the cursor is
> on empty space the find-file defaults to parent directory instead of
> current directory which I expected.
> For example, if the cursor is on empty line and current working
> directory is my home, then the find file starts in "/home/" instead of
> "/home/zmyrgel/".
> Is this the correct behaviour or is this a bug?

Please M-x report-emacs-bug and attach the patch below.

=== modified file 'lisp/ido.el'
--- lisp/ido.el 2010-01-18 19:34:55 +0000
+++ lisp/ido.el 2010-02-27 16:02:36 +0000
@@ -2288,7 +2288,9 @@
               (not (string-match "^http:/" fn))
-              (setq d (file-name-directory (expand-file-name fn)))
+              (setq d (if (file-directory-p (expand-file-name fn))
+                          (file-name-as-directory (expand-file-name fn))
+                        (file-name-directory (expand-file-name fn))))
               (file-directory-p d))
          (setq ido-current-directory d)
          (setq initial (file-name-nondirectory fn))))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]