Ensure switch hooks don't reference dead buffers
This commit is contained in:
parent
9c4d1c3b02
commit
4c18fc81af
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue