If you run the ido-find-file command (ALT-f using Casey's .emacs), and you enter in a file that does not exist, Emacs will try searching other directories, and will switch if it finds one of the same name somewhere else. Casey talks about this and how he doesn't like it starting at 10:20 in his Basic Emacs Tutorial:

I looked into it, and putting this into my .emacs file fixed the problem:

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



I made similar changes for find-file:

1
2
(setq ff-search-directories '("."))
(setq ff-always-try-to-create t)


Tested on 24.4.1 and 23.4.1 on Windows