Ensure *-local-vars-hook runs on hack-local-variables-hook

Not sure why I removed this in cd88f65, but it ruins the original
purpose of these hooks -- to run after local variables have been set.
This commit is contained in:
Henrik Lissner 2021-06-02 23:12:38 -04:00
parent 617ab847c6
commit 72c3a79132

View file

@ -394,6 +394,14 @@ config.el instead."
(setq-local doom-inhibit-local-var-hooks t)
(doom-run-hooks (intern-soft (format "%s-local-vars-hook" major-mode)))))
;; If the user has disabled `enable-local-variables', then
;; `hack-local-variables-hook' is never triggered, so we trigger it at the end
;; of `after-change-major-mode-hook':
(defun doom-run-local-var-hooks-maybe-h ()
"Run `doom-run-local-var-hooks-h' if `enable-local-variables' is disabled."
(unless enable-local-variables
(doom-run-local-var-hooks-h)))
;;
;;; Incremental lazy-loading
@ -654,7 +662,8 @@ to least)."
(eval-after-load 'straight '(doom-initialize-packages))
;; Bootstrap the interactive session
(add-hook 'after-change-major-mode-hook #'doom-run-local-var-hooks-h)
(add-hook 'after-change-major-mode-hook #'doom-run-local-var-hooks-maybe-h 100)
(add-hook 'hack-local-variables-hook #'doom-run-local-var-hooks-h)
(add-hook 'emacs-startup-hook #'doom-load-packages-incrementally-h)
(add-hook 'window-setup-hook #'doom-display-benchmark-h)
(doom-run-hook-on 'doom-first-buffer-hook '(find-file-hook doom-switch-buffer-hook))