From 024e27b618d4b8ab72243c7b10a3d18439709d31 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 5 Mar 2019 17:08:39 -0500 Subject: [PATCH] Add contingency plan for local-vars hooks They don't run if enable-local-variables is set to nil. --- core/core.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/core.el b/core/core.el index 9ec60a803..344949d54 100644 --- a/core/core.el +++ b/core/core.el @@ -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