feat: add doom-{before,after}-init-hook

doom-before-init-hook runs before $DOOMDIR/init.el is loaded.

doom-after-init-hook runs at the *very* end of the Emacs startup
process (after window-setup-hook).
This commit is contained in:
Henrik Lissner 2022-09-14 19:01:57 +02:00
parent 18cd2eb483
commit 0d7c3eaf24
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
4 changed files with 81 additions and 34 deletions

View file

@ -622,10 +622,7 @@ triggering hooks during startup."
;; Initialize `doom-switch-buffer-hook'
(add-hook 'window-buffer-change-functions #'doom-run-switch-buffer-hooks-h)
;; `window-buffer-change-functions' doesn't trigger for files visited via the server.
(add-hook 'server-visit-hook #'doom-run-switch-buffer-hooks-h)
;; Only execute this function once.
(remove-hook 'window-buffer-change-functions #'doom-init-ui-h))
(add-hook 'server-visit-hook #'doom-run-switch-buffer-hooks-h))
;; Apply fonts and theme
(let ((hook (if (daemonp)
@ -636,7 +633,7 @@ triggering hooks during startup."
;; Initialize UI as late as possible. `window-buffer-change-functions' runs
;; once, when the scratch/dashboard buffer is first displayed.
(add-hook 'window-buffer-change-functions #'doom-init-ui-h -100)
(add-hook 'doom-after-init-hook #'doom-init-ui-h -100)
;;