nit: revise init hook docstrings & load order commentary

This commit is contained in:
Henrik Lissner 2022-09-23 22:12:25 +02:00
parent a3a275624e
commit 2fc3442508
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -38,6 +38,7 @@
;; > $EMACSDIR/lisp/doom-start.el ;; > $EMACSDIR/lisp/doom-start.el
;; - hook: `doom-before-init-hook' ;; - hook: `doom-before-init-hook'
;; - $DOOMDIR/init.el ;; - $DOOMDIR/init.el
;; - hook: `before-init-hook'
;; > $XDG_DATA_HOME/doom/$PROFILE/@/$VERSION/init.el (replaces $EMACSDIR/init.el) ;; > $XDG_DATA_HOME/doom/$PROFILE/@/$VERSION/init.el (replaces $EMACSDIR/init.el)
;; - $EMACSDIR/doom-{keybinds,ui,projects,editor}.el ;; - $EMACSDIR/doom-{keybinds,ui,projects,editor}.el
;; - hook: `doom-before-modules-init-hook' ;; - hook: `doom-before-modules-init-hook'
@ -48,7 +49,6 @@
;; - hook: `doom-after-modules-config-hook' ;; - hook: `doom-after-modules-config-hook'
;; - $DOOMDIR/config.el ;; - $DOOMDIR/config.el
;; - `custom-file' or $DOOMDIR/custom.el ;; - `custom-file' or $DOOMDIR/custom.el
;; > The rest of `command-line' (Emacs startup)
;; - hook: `after-init-hook' ;; - hook: `after-init-hook'
;; - hook: `emacs-startup-hook' ;; - hook: `emacs-startup-hook'
;; - hook: `window-setup-hook' ;; - hook: `window-setup-hook'
@ -560,27 +560,26 @@ Otherwise, `en/disable-command' (in novice.el.gz) is hardcoded to write them to
;;; Custom hooks ;;; Custom hooks
(defcustom doom-before-init-hook () (defcustom doom-before-init-hook ()
"A hook run before Doom has been initialized and before $DOOMDIR/init.el. "A hook run after Doom's core has initialized; before user configuration.
This occurs in the context of early-init.el. Much of Emacs and Doom isn't This is triggered right before $DOOMDIR/init.el is loaded, in the context of
initialized at this point, only loaded. Use this for configuration at the latest early-init.el. Use this for configuration at the latest opportunity before the
opportunity before the session becomes unpredictably complicated by user config, session becomes unpredictably complicated by user config, packages, etc. This
packages, etc. runs in both interactive and non-interactive contexts, so guard hooks
appropriately against `noninteractive' or the `cli' context (see
Do not use this for interactive functionality, as it's triggered in `doom-context').
noninteractive sessions as well, after Doom core has been loaded, but not
initialized.
In contrast, `before-init-hook' is run just after $DOOMDIR/init.el is loaded, In contrast, `before-init-hook' is run just after $DOOMDIR/init.el is loaded,
but before the rest of Doom is loaded." but long before your modules and $DOOMDIR/config.el are loaded."
:group 'doom :group 'doom
:type 'hook) :type 'hook)
(defcustom doom-after-init-hook () (defcustom doom-after-init-hook ()
"A hook run at the (true) end of Emacs startup. "A hook run once Doom's core and modules, and the user's config are loaded.
When this runs, all modules, config files, and startup hooks have been This triggers at the absolutel atest point in the eager startup process, and
triggered. This is the absolute latest point in the startup process." runs in both interactive and non-interactive sessions, so guard hooks
appropriately against `noninteractive' or the `cli' context."
:group 'doom :group 'doom
:type 'hook) :type 'hook)