Flip default kill flag in quit-window #309

This commit is contained in:
Henrik Lissner 2017-12-30 01:19:56 -05:00
parent b6eec664bb
commit 9632b8c09d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 8 additions and 2 deletions

View file

@ -239,7 +239,7 @@ without leaving any trace behind (muahaha)."
(if (featurep 'evil) (if (featurep 'evil)
#'evil-force-normal-state #'evil-force-normal-state
#'keyboard-quit)) #'keyboard-quit))
(delete-window))) (quit-restore-window nil 'kill)))
;;;###autoload ;;;###autoload
(defun doom/popup-this-buffer () (defun doom/popup-this-buffer ()

View file

@ -180,7 +180,7 @@ recognized by DOOM's popup system. They are:
(define-key map [escape] #'doom/popup-close-maybe) (define-key map [escape] #'doom/popup-close-maybe)
(define-key map (kbd "ESC") #'doom/popup-close-maybe) (define-key map (kbd "ESC") #'doom/popup-close-maybe)
(define-key map [remap quit-window] #'doom/popup-close-maybe) (define-key map [remap quit-window] #'doom/popup-close-maybe)
(define-key map [remap doom/kill-this-buffer] #'delete-window) (define-key map [remap doom/kill-this-buffer] #'doom/popup-close-maybe)
(define-key map [remap split-window-right] #'ignore) (define-key map [remap split-window-right] #'ignore)
(define-key map [remap split-window-below] #'ignore) (define-key map [remap split-window-below] #'ignore)
(define-key map [remap split-window-horizontally] #'ignore) (define-key map [remap split-window-horizontally] #'ignore)

View file

@ -235,6 +235,12 @@ instead)."
(get-buffer-window-list nil nil t)))) (get-buffer-window-list nil nil t))))
(add-hook 'kill-buffer-query-functions #'doom|protect-visible-buffers) (add-hook 'kill-buffer-query-functions #'doom|protect-visible-buffers)
;; temporary windows often have q bound to `quit-window', which only buries the
;; contained buffer. I rarely don't want that buffer killed, so...
(defun doom*quit-window (orig-fn &optional kill window)
(funcall orig-fn (not kill) window))
(advice-add #'quit-window :around #'doom*quit-window)
;; ;;
;; Plugins ;; Plugins