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.
To exit emacs, use C-x C-c . It will ask you whether you want to save the changes. To prevent the question, precede the combination with C-u (but it will save the changes). If you want to kill Emacs without saving any changes, you can use the kill-emacs function ( M-x kill-emacs ).
To close a particular buffer, hit the keys Ctrl + x, followed by k, and then enter the buffer name. To completely close and exit Emacs, hit the keys Ctrl + x, followed by Ctrl + c. It is important to note that this action saves the buffers first, before killing Emacs.
Quit emacs (Note: C-x means to press the control key and while you are holding it down, press x.
You can customize the value of save-some-buffers-default-predicate to control which buffers Emacs will ask about. C-x C-c , the key sequence to exit Emacs, invokes save-some-buffers and therefore asks the same questions.
There is a built-in variable you can set to a function like so:
(setq confirm-kill-emacs 'y-or-n-p)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With