Fix for persistent-server if server never got started
This commit is contained in:
parent
cd43db1caa
commit
f71eec61d0
|
@ -547,11 +547,18 @@ kill internal buffers too."
|
||||||
(defvar spacemacs-really-kill-emacs nil
|
(defvar spacemacs-really-kill-emacs nil
|
||||||
"prevent window manager close from closing instance.")
|
"prevent window manager close from closing instance.")
|
||||||
|
|
||||||
|
(defun spacemacs-persistent-server-running-p ()
|
||||||
|
"requires spacemacs-really-kill-emacs to be toggled and dotspacemacs-persistent-server to be t"
|
||||||
|
(and (fboundp 'server-running-p)
|
||||||
|
(server-running-p)
|
||||||
|
dotspacemacs-persistent-server))
|
||||||
|
|
||||||
(defadvice kill-emacs (around spacemacs-really-exit activate)
|
(defadvice kill-emacs (around spacemacs-really-exit activate)
|
||||||
"Only kill emacs if a prefix is set"
|
"Only kill emacs if a prefix is set"
|
||||||
(if (or spacemacs-really-kill-emacs (not dotspacemacs-persistent-server))
|
(if (and (not spacemacs-really-kill-emacs) (spacemacs-persistent-server-running-p))
|
||||||
ad-do-it
|
(spacemacs/frame-killer)
|
||||||
(spacemacs/frame-killer)))
|
ad-do-it
|
||||||
|
))
|
||||||
|
|
||||||
(defadvice save-buffers-kill-emacs (around spacemacs-really-exit activate)
|
(defadvice save-buffers-kill-emacs (around spacemacs-really-exit activate)
|
||||||
"Only kill emacs if a prefix is set"
|
"Only kill emacs if a prefix is set"
|
||||||
|
|
Loading…
Reference in New Issue