diff --git a/core/core-ui.el b/core/core-ui.el index 7c3f35814..1b94a01b0 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -280,6 +280,21 @@ DEFAULT is non-nil, set the default mode-line for all buffers." (add-hook 'server-visit-hook 'server-remove-kill-buffer-hook) +;; +;; Custom hooks +;; + +(defun doom*after-switch-window-hooks (&rest _) + (run-hooks 'doom-after-switch-window-hook)) +(defun doom*before-switch-window-hooks (&rest _) + (run-hooks 'doom-before-switch-window-hook)) + +(advice-add #'select-frame :before #'doom*before-switch-window-hooks) +(advice-add #'select-frame :after #'doom*after-switch-window-hooks) +(advice-add #'select-window :before #'doom*before-switch-window-hooks) +(advice-add #'select-window :after #'doom*after-switch-window-hooks) + + ;; ;; Line numbers ;;