7

The problem is quite simple but frustrating. When I try to visit a new file with C-x C-f which is named basis.m emacs keeps visiting the similar named file haarbasis.m which already exists in the same directory. It keeps prompting me for similar names and I am unable to visit a new empty file. I had recently installed elpy for a python IDE if it makes any difference.

How can I force emacs not to visit a file with C-x C-f unless I explicitly state which file to visit?

mhourdakis
  • 179
  • 8
  • I think you mean C-x C-f? C-x f runs set-fill-column. Does it work if you start Emacs with --no-init-file? If so, maybe you added some configuration to mess up C-x C-f? Possible workaround: Save your file with C-x C-w, then you get prompted for a filename. – asjo May 17 '13 at 18:16
  • Yes, that's what I mean, thank you. – mhourdakis May 18 '13 at 18:35

2 Answers2

8

elpy loads idomenu which in turn loads ido. What you are describing sounds like ido-powered completion of file names. You can disable it after C-x C-f by pressing C-f.

Alex Vorobiev
  • 4,349
  • 21
  • 29
1

As Alex mentions the string of packages that brought you to ido-mode, this answer depends on the answer to your statement below, which may be why something is happening to you when you do C-x C-f

When I try to visit a new file...

When your pointer/cursor is at the end of a word, idowill look for a file in the current directory with that name. It may even traverse down the relative path too if it's set up like a file directory structure e.g. show/basis.m

The commentor Jon O says, Even if this is happening C-j will create a new file for you.

pjammer
  • 9,489
  • 5
  • 46
  • 56