3 ms·
;;; Make it more difficult to kill emacs accidentally (defun my-kill-emacs () "Confirm before 'save-buffers-kill-emacs'." (interactive) (if (y-or-
by joosters 6y ago
;;; Make it more difficult to kill emacs accidentally
(defun my-kill-emacs ()
"Confirm before 'save-buffers-kill-emacs'."
(interactive)
(if (y-or-n-p "Really kill Emacs? ")
(save-buffers-kill-emacs)
(message "Aborted")
)
)
(global-set-key "\C-x\C-c" 'my-kill-emacs)
- jimmyvalmer 6y agoDude, `M-x custom-set-variable RET confirm-kill-emacs RET TAB`
- morelisp 6y agoOr just unbind it, you won't typo `M-x kill-emacs`...
- fennecfoxen 6y agoTBH it actually helps me a little. I seldom lose any work at all, and I have to remember to commit editor config changes somewhere persistent. :P