all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Correct ido behavior?
@ 2010-02-27 13:56 Timo Myyra
  2010-02-27 16:05 ` Óscar Fuentes
  0 siblings, 1 reply; 2+ messages in thread
From: Timo Myyra @ 2010-02-27 13:56 UTC (permalink / raw
  To: emacs-devel

Hi,

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?

-- 
Timo Myyrä                . O .
http://www.wickedbsd.net  . . O
timo.myyra@gmail.com      O O O





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Correct ido behavior?
  2010-02-27 13:56 Correct ido behavior? Timo Myyra
@ 2010-02-27 16:05 ` Óscar Fuentes
  0 siblings, 0 replies; 2+ messages in thread
From: Óscar Fuentes @ 2010-02-27 16:05 UTC (permalink / raw
  To: emacs-devel; +Cc: Timo Myyra

Timo Myyra <timo.myyra@gmail.com> 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 @@
 			      (ffap-guesser)
 			    (ffap-string-at-point))))
 	       (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))))))





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-27 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-27 13:56 Correct ido behavior? Timo Myyra
2010-02-27 16:05 ` Óscar Fuentes

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.