Skip to content

Commit

Permalink
Ensure *-local-vars-hook runs on hack-local-variables-hook
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hlissner committed Jun 3, 2021
1 parent 617ab84 commit 72c3a79
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/core.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 72c3a79

Please sign in to comment.