all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Óscar Fuentes" <ofv@wanadoo.es>
To: emacs-devel@gnu.org
Cc: Timo Myyra <timo.myyra@gmail.com>
Subject: Re: Correct ido behavior?
Date: Sat, 27 Feb 2010 17:05:43 +0100	[thread overview]
Message-ID: <87k4tyy888.fsf@telefonica.net> (raw)
In-Reply-To: 87ljeesrxf.fsf@cube.wickedbsd.net

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))))))





      reply	other threads:[~2010-02-27 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-27 13:56 Correct ido behavior? Timo Myyra
2010-02-27 16:05 ` Óscar Fuentes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k4tyy888.fsf@telefonica.net \
    --to=ofv@wanadoo.es \
    --cc=emacs-devel@gnu.org \
    --cc=timo.myyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.