Add contingency plan for local-vars hooks

They don't run if enable-local-variables is set to nil.
This commit is contained in:
Henrik Lissner 2019-03-05 17:08:39 -05:00
parent 1ec9f5b2e9
commit 024e27b618
No known key found for this signature in database
GPG Key ID: 5F6C0EA160557395

View File

@ -237,6 +237,13 @@ original value of `symbol-file'."
#'doom-try-run-hook))
(add-hook 'hack-local-variables-hook #'doom|run-local-var-hooks)
(defun doom|run-local-var-hooks-if-necessary ()
"If `enable-local-variables' is disabled, then `hack-local-variables-hook' is
never triggered."
(unless enable-local-variables
(doom|run-local-var-hooks)))
(add-hook 'after-change-major-mode-hook #'doom|run-local-var-hooks-if-necessary)
;;
;; Incremental lazy-loading