diff --git a/core/core.el b/core/core.el index 7c0fc5e11..3d08702eb 100644 --- a/core/core.el +++ b/core/core.el @@ -366,12 +366,12 @@ 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) +(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) + (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))) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 4c565cb96..ec98b0f82 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -226,11 +226,13 @@ This forces it to read the background before rendering." (if (and (eq org-src-window-setup 'switch-invisibly) (functionp initialize)) ;; org-babel-do-in-edit-buffer is used to execute quick, one-off - ;; logic in the context of another major mode. Initializing this - ;; major mode can be terribly expensive (particular its mode - ;; hooks), so we inhibit them. + ;; logic in the context of another major mode, but initializing a + ;; major mode with expensive hooks can be terribly expensive. + ;; Since Doom adds its most expensive hooks to + ;; MAJOR-MODE-local-vars-hook, we can savely inhibit those. (lambda () - (quiet! (delay-mode-hooks (funcall initialize)))) + (let ((doom-inhibit-local-var-hooks t)) + (funcall initialize))) initialize) args)) diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index 302b8d38a..f5ff76ec3 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -247,7 +247,7 @@ called.") (pyenv-mode +1) (when (executable-find "pyenv") (add-to-list 'exec-path (expand-file-name "shims" (or (getenv "PYENV_ROOT") "~/.pyenv")))) - (add-hook 'python-mode-hook #'+python-pyenv-mode-set-auto-h) + (add-hook 'python-mode-local-vars-hook #'+python-pyenv-mode-set-auto-h) (add-hook 'doom-switch-buffer-hook #'+python-pyenv-mode-set-auto-h))