mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
run-hook-with-args => run-hooks, in custom hooks
This commit is contained in:
@ -336,21 +336,21 @@ from the default."
|
|||||||
(defun doom*switch-frame-hooks (orig-fn frame &optional norecord)
|
(defun doom*switch-frame-hooks (orig-fn frame &optional norecord)
|
||||||
(if (eq frame (selected-frame))
|
(if (eq frame (selected-frame))
|
||||||
(funcall orig-fn frame norecord)
|
(funcall orig-fn frame norecord)
|
||||||
(run-hook-with-args 'doom-before-switch-frame-hook)
|
(run-hooks 'doom-before-switch-frame-hook)
|
||||||
(prog1 (funcall orig-fn frame norecord)
|
(prog1 (funcall orig-fn frame norecord)
|
||||||
(run-hook-with-args 'doom-after-switch-frame-hook))))
|
(run-hooks 'doom-after-switch-frame-hook))))
|
||||||
(defun doom*switch-window-hooks (orig-fn window &optional norecord)
|
(defun doom*switch-window-hooks (orig-fn window &optional norecord)
|
||||||
(if (or (eq window (selected-window))
|
(if (or (eq window (selected-window))
|
||||||
(window-minibuffer-p)
|
(window-minibuffer-p)
|
||||||
(window-minibuffer-p window))
|
(window-minibuffer-p window))
|
||||||
(funcall orig-fn window norecord)
|
(funcall orig-fn window norecord)
|
||||||
(run-hook-with-args 'doom-before-switch-window-hook)
|
(run-hooks 'doom-before-switch-window-hook)
|
||||||
(prog1 (funcall orig-fn window norecord)
|
(prog1 (funcall orig-fn window norecord)
|
||||||
(run-hook-with-args 'doom-after-switch-window-hook))))
|
(run-hooks 'doom-after-switch-window-hook))))
|
||||||
(defun doom*switch-buffer-hooks (orig-fn &rest args)
|
(defun doom*switch-buffer-hooks (orig-fn &rest args)
|
||||||
(run-hook-with-args 'doom-before-switch-buffer-hook)
|
(run-hooks 'doom-before-switch-buffer-hook)
|
||||||
(prog1 (apply orig-fn args)
|
(prog1 (apply orig-fn args)
|
||||||
(run-hook-with-args 'doom-after-switch-buffer-hook)))
|
(run-hooks 'doom-after-switch-buffer-hook)))
|
||||||
|
|
||||||
(advice-add #'select-frame :around #'doom*switch-frame-hooks)
|
(advice-add #'select-frame :around #'doom*switch-frame-hooks)
|
||||||
(advice-add #'select-window :around #'doom*switch-window-hooks)
|
(advice-add #'select-window :around #'doom*switch-window-hooks)
|
||||||
@ -359,7 +359,7 @@ from the default."
|
|||||||
|
|
||||||
(defun doom*load-theme-hooks (theme &rest _)
|
(defun doom*load-theme-hooks (theme &rest _)
|
||||||
(setq doom-theme theme)
|
(setq doom-theme theme)
|
||||||
(run-hook-with-args 'doom-load-theme-hook))
|
(run-hooks 'doom-load-theme-hook))
|
||||||
(advice-add #'load-theme :after #'doom*load-theme-hooks)
|
(advice-add #'load-theme :after #'doom*load-theme-hooks)
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user