Ensure switch hooks don't reference dead buffers

This commit is contained in:
Henrik Lissner 2018-08-13 18:21:07 +02:00
parent 9c4d1c3b02
commit 4c18fc81af
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -315,8 +315,9 @@ from the default."
(let ((doom-inhibit-switch-buffer-hooks t)) (let ((doom-inhibit-switch-buffer-hooks t))
(run-hooks 'doom-exit-buffer-hook) (run-hooks 'doom-exit-buffer-hook)
(prog1 (apply orig-fn buffer-or-name args) (prog1 (apply orig-fn buffer-or-name args)
(when (buffer-live-p (get-buffer buffer-or-name))
(with-current-buffer buffer-or-name (with-current-buffer buffer-or-name
(run-hooks 'doom-enter-buffer-hook)))))) (run-hooks 'doom-enter-buffer-hook)))))))
(defun doom|init-custom-hooks (&optional disable) (defun doom|init-custom-hooks (&optional disable)
(dolist (spec '((select-window . doom*switch-window-hooks) (dolist (spec '((select-window . doom*switch-window-hooks)