2

When I try to create a new file in Emacs with C-x C-f, typing the file name, the Completion always automatically match the name. Unfortunately, once Emacs finds out there be no matched file, it will try to look for the file with the name I just typed in other paths. So when there is a file with the same name in other path, I cannot create this file in the current path. Any one would tell me how to escape this annoying problem?

Drew
  • 29,895
  • 7
  • 74
  • 104
yangdawei
  • 57
  • 6

1 Answers1

0

The question is unclear, and so risks being closed. Try to give a step-by-step recipe of what you do, starting from emacs -Q (no init file), to repro the problem.

By default (in vanilla Emacs), C-x C-f is bound to find-file, and it does not search multiple "paths". It looks only in the current directory (default-directory) unless you change the directory in the minibuffer during the command.

Start by using C-h k C-x C-f, to see what command you are actually using.

Drew
  • 29,895
  • 7
  • 74
  • 104
  • Completion feature always matches the file name I type in mini buffer. For example there is a path /a and a file named test.txt and a subpath /a/b existed in it. Now I try to create a test.txt. Completion feature will automatically find the first file and refuse to create test.txt in /a/b. – yangdawei Aug 17 '15 at 16:06
  • Again, a **step-by-step** recipe, please, starting from `emacs -Q` (no init file). – Drew Aug 17 '15 at 17:11
  • No completion features by `emacs -Q`, so the file is created normally. Thank you. But how to make a file with launching init file ? – yangdawei Aug 18 '15 at 00:18
  • As a advise from my friend, typing 'C-f' immediately after 'C-x C-f' could void completion and create the new file. So I believe my problem be solved. Thank you very much. – yangdawei Aug 18 '15 at 00:23
  • Sounds like you're using Ido mode ("Interactive Do"). You should be aware of that, so you can ask Emacs for help about Ido mode when you have other trouble with it. Ido mode is not the default/ordinary way that Emacs does completion. See the Ido manual (`C-h i` and choose `Ido` in the menu). – Drew Aug 18 '15 at 00:29