Search code examples
emacsconfirmationquit

Prevent Emacs from exiting once the exit procedure has initiated?


Is there a way to prevent Emacs from exiting once I initiate the exit process?

I occasionally fat finger C-xC-s as C-xC-c. It isn't an awful process to get back up and running but I am curious if there is a way I can stop the exit process so that I can continue uninterrupted with all my files open.

Using GNU Emacs 24.3.1. Running on Cygwin under Window 7.


Solution

  • There is a built-in variable you can set to a function like so:

    (setq confirm-kill-emacs 'y-or-n-p)