41

I use ido mode. Here is how I set in .emacs

(require 'ido) (setq ido-enable-flex-matching t) (setq ido-everywhere t) (ido-mode t) 

When I open a file, I do C-x C-f my_file and if it doesn't exist in current directory, emacs will try to search for it in other recent used directories in about a second. However, most of the time I was just trying to create new files. I had to type the file name really fast and then C-j to confirm it. How can I stop ido from doing this?

6
  • alias 'open new file' as some key other then C-x C-f (M-x find-file is the right name of the action) Commented Aug 1, 2013 at 6:00
  • 3
    @user2141046 @woodings From ido-find-file you can just hit C-x C-f again to drop down into the traditional find-file interface Commented Aug 1, 2013 at 6:02
  • 1
    @assem I don't want to fall back to normal find-file. I need ido but not search in other directories. Commented Aug 1, 2013 at 6:05
  • 1
    @assem It's just C-f. Commented Aug 1, 2013 at 6:16
  • @abo-abo oh, yes indeed it is, thanks Commented Aug 1, 2013 at 10:54

3 Answers 3

42

The following will completely disable the feature:

(setq ido-auto-merge-work-directories-length -1) 

I've never seen any value in it, so disabling it completely might make sense for a lot of people.

Sign up to request clarification or add additional context in comments.

1 Comment

M-x customize-variable ido-auto-merge-work-directories-length
16

Here is another option using Ido:

  1. Type C-x C-f as usual.
  2. Find the directory you want to create the new file in using Ido search.
  3. At any moment type C-f again, and Emacs will go back to the old find-file functionality.

You can then type the file name you want and Emacs will create a new buffer. So, if you type C-x C-f C-f file_name RET it will create a buffer called file_name temporarily in the current directory.

Comments

12

I found an easy solution:

(setq ido-auto-merge-delay-time 9) 

The time here is in seconds. I could set a very large number to completely disable this feature.

2 Comments

or set ido-auto-merge-work-directories-length to -1 to disable
@woodings, this problem really annoyed me for a while when I use ido, finally, I decided to search the solution. Before I got this page, I found that when you using ido, you can just use C-f to go back to normal mode instead of ido, but your solution seems better. Thank you!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.