Added prompt option as default, to prevent quiting and losing all changes.
This commit is contained in:
parent
bfe5f520ae
commit
af2b9913ba
|
@ -2003,8 +2003,10 @@ server is to use the following bindings:
|
|||
|
||||
Key Binding | Description
|
||||
-------------------|------------------------------------------------------------
|
||||
<kbd>SPC q q</kbd> | Quit Emacs and kill the server
|
||||
<kbd>SPC q q</kbd> | Quit Emacs and kill the server, prompt for changed buffers to save
|
||||
<kbd>SPC q Q</kbd> | Quit Emacs and kill the server, lose all unsaved changes.
|
||||
<kbd>SPC q s</kbd> | Save the buffers, quit Emacs and kill the server
|
||||
<kbd>SPC q z</kbd> | Kill the current frame
|
||||
|
||||
## Troubleshoot
|
||||
|
||||
|
|
|
@ -603,19 +603,28 @@ kill internal buffers too."
|
|||
(spacemacs/frame-killer)))
|
||||
|
||||
(defun spacemacs/save-buffers-kill-emacs ()
|
||||
"Save all changed buffers and exit Spacemacs"
|
||||
(interactive)
|
||||
(setq spacemacs-really-kill-emacs t)
|
||||
(save-buffers-kill-emacs))
|
||||
|
||||
(defun spacemacs/kill-emacs ()
|
||||
"Lose all changes and exit Spacemacs"
|
||||
(interactive)
|
||||
(setq spacemacs-really-kill-emacs t)
|
||||
(kill-emacs))
|
||||
|
||||
(defun spacemacs/frame-killer ()
|
||||
"Exit server buffers and hide the main Emacs window"
|
||||
(defun spacemacs/prompt-kill-emacs ()
|
||||
"Prompt to save changed buffers and exit Spacemacs"
|
||||
(interactive)
|
||||
(server-edit)
|
||||
(setq spacemacs-really-kill-emacs t)
|
||||
(save-some-buffers)
|
||||
(kill-emacs))
|
||||
|
||||
(defun spacemacs/frame-killer ()
|
||||
"Kill server buffer and hide the main Emacs window"
|
||||
(interactive)
|
||||
(server-kill-buffer)
|
||||
(make-frame-invisible nil 1))
|
||||
|
||||
;; A small minor mode to use a big fringe
|
||||
|
|
|
@ -202,8 +202,10 @@
|
|||
:evil-leader "t SPC")
|
||||
;; quit -----------------------------------------------------------------------
|
||||
(evil-leader/set-key
|
||||
"q s" 'spacemacs/save-buffers-kill-emacs
|
||||
"q q" 'spacemacs/kill-emacs)
|
||||
"qs" 'spacemacs/save-buffers-kill-emacs
|
||||
"qq" 'spacemacs/prompt-kill-emacs
|
||||
"qQ" 'spacemacs/kill-emacs
|
||||
"qz" 'spacemacs/frame-killer)
|
||||
;; window ---------------------------------------------------------------------
|
||||
(defun split-window-below-and-focus ()
|
||||
"Split the window vertically and focus the new window."
|
||||
|
|
Loading…
Reference in a new issue