I was not the only one who thought ido is very inconvenient when trying to write a new file. The emacs wiki has a section dedicated to disabling ido for write-file:

Disable ido mode for particular commands, e.g. write-file

Their suggestion is to turn off ido for write file using:

 (define-key (cdr ido-minor-mode-map-entry) [remap write-file] nil)

This does not seem to work for me. ido still runs when I hit C-x C-w. Any suggestions?

  • 1
    I know I can exit ido with C-f. That is not a satisfactory solution.
    – Snelephant
    Sep 6 '16 at 1:19
  • FYI: The ido.el library is disabled by default when starting with emacs -q -- i.e., no user configuration. If you start with no user configuration and then type M-x eval-expression RET (featurep 'ido) RET you will see that the return value is nil because it is not loaded by default.
    – lawlist
    Sep 6 '16 at 2:12
  • I too am annoyed by this. My solution is just type file name and hit C-j.
    – Xah Lee
    Sep 6 '16 at 10:35
  • Lawlist, (featurep 'ido) returns t. So I assume the user configuration is loaded.
    – Snelephant
    Sep 7 '16 at 8:20
  • Xah Lee (honored), My motivation is that I need to save frequent iterations of a file (long_filename_01, long_filename_02, etc. and git style versioning is not an option) so I use C-x C-w C-f M-n to edit just the last character in the filename. That is lot of chording for such a common and important action.
    – Snelephant
    Sep 7 '16 at 8:26

the following should work.

(require 'ido)
(define-key (cdr ido-minor-mode-map-entry) [remap write-file] nil)

the problem was caused by ido not initialized. Need the (ido-mode) line there.

  • The second line produces Wrong type argument: keymapp, nil
    – Snelephant
    Oct 25 '16 at 2:21
  • that means for some reason you don't have ido-minor-mode-map-entry defined. (the cdr part of that variable should be a keymap, but you got nil) What emacs version are you using? also, did you run that require ido line?
    – Xah Lee
    Oct 28 '16 at 21:51
  • The code is in my init.el exactly as shown in your answer, including the require ido line. No other references to ido in my initialization. Version: Emacs 25.1.1 (x86_64-w64-mingw32)
    – Snelephant
    Dec 6 '16 at 15:09
  • i modified the answer. need the (ido-mode) line. try that. I tried, worked now. also on emacs 25.1.
    – Xah Lee
    Dec 7 '16 at 18:22
  • If you use (setq ido-everywhere t) you'll need also (add-to-list 'ido-read-file-name-non-ido 'write-file). Feb 9 '20 at 9:10

Use C-x C-f C-f to bypass ido-mode when it gets in the way.

To "save as", same: C-x C-w C-w but this time you stay in ido-mode, only you can edit the prompt.

  • I think it's C-f to bypass ido-mode even when in "Write file"
    – Oin
    Apr 13 '19 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.