Skip to content

Instantly share code, notes, and snippets.

@xificurC
Last active November 3, 2015 01:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xificurC/34535c6c2d4a9d0c4f7a to your computer and use it in GitHub Desktop.
Save xificurC/34535c6c2d4a9d0c4f7a to your computer and use it in GitHub Desktop.
spacemacs prompt for kill-emacs
(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