Fix #3390: only execute local-vars hooks once

This commit is contained in:
Henrik Lissner 2020-08-02 16:28:56 -04:00
parent 7784c0b6e9
commit c7513e4135
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -341,10 +341,14 @@ config.el instead."
;; File+dir local variables are initialized after the major mode and its hooks
;; have run. If you want hook functions to be aware of these customizations, add
;; them to MODE-local-vars-hook instead.
(defvar doom--inhibit-local-var-hooks nil)
(defun doom-run-local-var-hooks-h ()
"Run MODE-local-vars-hook after local variables are initialized."
(unless doom--inhibit-local-var-hooks
(set (make-local-variable 'doom--inhibit-local-var-hooks) t)
(run-hook-wrapped (intern-soft (format "%s-local-vars-hook" major-mode))
#'doom-try-run-hook))
#'doom-try-run-hook)))
;; If the user has disabled `enable-local-variables', then
;; `hack-local-variables-hook' is never triggered, so we trigger it at the end