(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)