Last active
November 3, 2015 01:30
-
-
Save xificurC/34535c6c2d4a9d0c4f7a to your computer and use it in GitHub Desktop.
spacemacs prompt for kill-emacs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(advice-remove 'kill-emacs 'spacemacs-really-exit) | |
(defun ad-advice-kill-emacs (orig-fun) | |
"Prompt before killing." | |
(if (and (not spacemacs-really-kill-emacs) | |
(spacemacs/persistent-server-running-p)) | |
(when (y-or-n-p "Really kill frame?") | |
(spacemacs/frame-killer)) | |
(when (y-or-n-p "Really exit?") | |
(funcall orig-fun)))) | |
(advice-add 'kill-emacs :around 'ad-advice-kill-emacs) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment