mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-28 16:51:08 -05:00
Ensure switch hooks don't reference dead buffers
This commit is contained in:
@@ -315,8 +315,9 @@ from the default."
|
||||
(let ((doom-inhibit-switch-buffer-hooks t))
|
||||
(run-hooks 'doom-exit-buffer-hook)
|
||||
(prog1 (apply orig-fn buffer-or-name args)
|
||||
(with-current-buffer buffer-or-name
|
||||
(run-hooks 'doom-enter-buffer-hook))))))
|
||||
(when (buffer-live-p (get-buffer buffer-or-name))
|
||||
(with-current-buffer buffer-or-name
|
||||
(run-hooks 'doom-enter-buffer-hook)))))))
|
||||
|
||||
(defun doom|init-custom-hooks (&optional disable)
|
||||
(dolist (spec '((select-window . doom*switch-window-hooks)
|
||||
|
Reference in New Issue
Block a user