unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16747: 24.3.50; ido-find-file with ido-use-filename-at-point in dired inserts directory at point twice
@ 2014-02-14  6:05 Dmitry Gutov
  2014-02-14  6:52 ` Leo Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2014-02-14  6:05 UTC (permalink / raw)
  To: 16747

[-- Attachment #1: Type: text/plain, Size: 494 bytes --]

Tags: patch

1. (setq ido-use-filename-at-point t)

2. M-x ido-mode

3. Open a Dired buffer, move point to a directory, press C-x C-f.

4. See the directory name inserted in the prompt both as directory and a
file name.

In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.6)
 of 2014-02-07 on axl
Repository revision: 116299 rgm@gnu.org-20140207032552-3ycw6hai2zl7yynq
Windowing system distributor `The X.Org Foundation', version 11.0.11405000
System Description:	Ubuntu 13.10


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: ido-use-filename-at-point.diff --]
[-- Type: text/x-diff, Size: 1173 bytes --]

=== modified file 'lisp/ido.el'
--- lisp/ido.el	2014-01-31 06:34:44 +0000
+++ lisp/ido.el	2014-02-14 05:59:01 +0000
@@ -2375,14 +2375,14 @@
 			  (if (eq ido-use-filename-at-point 'guess)
 			      (ffap-guesser)
 			    (ffap-string-at-point))))
-	       (not (string-match "^http:/" 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))))))
+	       (not (string-match "^http:/" fn)))
+          (let ((absolute-fn (expand-file-name fn)))
+            (cond
+             ((file-directory-p absolute-fn)
+              (setq ido-current-directory (file-name-as-directory absolute-fn)))
+             ((file-directory-p (file-name-directory absolute-fn))
+              (setq ido-current-directory (file-name-directory absolute-fn))
+              (setq initial (file-name-nondirectory absolute-fn)))))))))
 
     (let (ido-saved-vc-hb
 	  (vc-handled-backends (and (boundp 'vc-handled-backends) vc-handled-backends))


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

end of thread, other threads:[~2014-02-16  4:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-14  6:05 bug#16747: 24.3.50; ido-find-file with ido-use-filename-at-point in dired inserts directory at point twice Dmitry Gutov
2014-02-14  6:52 ` Leo Liu
2014-02-14 12:18   ` Dmitry Gutov
2014-02-15  9:36     ` Leo Liu
2014-02-16  4:17       ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).