emacs won't close because of buffer "ido.last"
When I try to close emacs I get the message
"buffer i开发者_开发技巧do.last modified; kill anyway?"
and whatever I answer, emacs stays open. But I can't open this buffer and the ido.last file doesn't exist. How can I get my emacs closed?
If you've used emacs as another user, as root for instance, it's possible that the .ido.last file is owned by root and hence you aren't allowed to remove or save it.
When you get the "buffer .ido.last modified"-question just remove the .ido.last file before you answer yes (if you're using emacs within a shell, just C-z, remove file and then resume with %). Then the .ido.last file will be written to disk with you as the owner.
IDO tries to save a file called ido.last
into ~/.emacs.d
directory. But, in your case IDO seems to be unable to do so. Maybe your ~/.emacs.d
directory is read-only for a particular reason, or your disk is full, etc. So IDO raise an error that prevent your emacs to close.
If you don't use IDO, try to remove this kind of lines from your .emacs :
(require 'ido)
(ido-mode t)
Add this code (eg. to your .emacs.el
, init.el
, etc.) to
fix the issue with ido preventing emacs from exiting
when the ido.last
file is not writable:
(defun ido-kill-emacs-hook ()
(ignore-errors (ido-save-history)))
Like Jérôme Radix said, IDO gives that error when unable to save the ido.last
file, and the error prevents emacs from closing.
The default location for IDO to save the file is into ~/.emacs.d
directory, but this can be overridden by setting the variable ido-save-directory-list-file
. This means you should check the value of this variable (e.g., M-x describe-variable
) to see where IDO is trying to save a file, and figure out why it can't save the file.
Possible reasons include:
- The directory or file is read-only.
- The directory does not exist. IDO will not create the directory for you.
- The directory or file is owned by another user.
- The disk is full.
精彩评论