3

Using Emacs with ido mode enabled on Windows, Emacs tries to save a history file .ido.last when exiting. The file is located in C:/.ido.last, but it fails with a permission denied message. This is strange since I actually have access to that folder. However:

Is there a command to change the directory where the .ido.last file gets saved?

tjm
  • 105
  • 1
  • 9
  • Remove `C:\.emacs` (or `C:\_emacs`), and Emacs will default to the more modern default of `C:\Users\[username]\Application Data`. It only uses `C:\` as the location of such files if it finds a .emacs there, to be backward compatible with old Emacs versions. – JSON Feb 24 '14 at 06:36

1 Answers1

5

Short answer: (setq ido-save-directory-list-file "/some/file/name").

Long answer:

I keep all the little files that remember Emacs's state in a single directory under the user-emacs-directory. I'm not sure what this is on Windows, but I think it's C:\Users\<username>\Application Data\.emacs.d\. On Unix, it's ~/.emacs.d/. The variable user-emacs-directory should be defined by Emacs, no need to set it.

(setq emacs-persistence-directory (concat user-emacs-directory "persistence/"))
(unless (file-exists-p emacs-persistence-directory)
    (make-directory emacs-persistence-directory t))
(setq ido-save-directory-list-file (concat emacs-persistence-directory
                                           "ido-last"))

You may want to look at the no-littering package, which sets better default locations for files like this.

jpkotta
  • 9,237
  • 3
  • 29
  • 34