run-hook-with-args => run-hooks, in custom hooks
This commit is contained in:
parent
4603a4e113
commit
eb5fd0aa53
1 changed files with 7 additions and 7 deletions
|
@ -336,21 +336,21 @@ from the default."
|
|||
(defun doom*switch-frame-hooks (orig-fn frame &optional norecord)
|
||||
(if (eq frame (selected-frame))
|
||||
(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)
|
||||
(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)
|
||||
(if (or (eq window (selected-window))
|
||||
(window-minibuffer-p)
|
||||
(window-minibuffer-p window))
|
||||
(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)
|
||||
(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)
|
||||
(run-hook-with-args 'doom-before-switch-buffer-hook)
|
||||
(run-hooks 'doom-before-switch-buffer-hook)
|
||||
(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-window :around #'doom*switch-window-hooks)
|
||||
|
@ -359,7 +359,7 @@ from the default."
|
|||
|
||||
(defun doom*load-theme-hooks (theme &rest _)
|
||||
(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)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue