diff --git a/core/core-editor.el b/core/core-editor.el index 929e02cba..96de4e8ab 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -58,6 +58,12 @@ modes are active and the buffer is read-only.") (ignore (bury-buffer)))) (add-hook 'kill-buffer-query-functions #'doom|dont-kill-scratch-buffer) +;; 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) + (defun doom|check-large-file () "Check if the buffer's file is large (see `doom-large-file-size'). If so, ask for confirmation to open it literally (read-only, disabled undo and in diff --git a/core/core-ui.el b/core/core-ui.el index e4728f3c4..4ddd15dbd 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -236,12 +236,6 @@ instead)." (add-hook! doom-post-init (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