mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-12 15:36:53 -05:00
Fix #3787: only inhibit some hooks for org-src ops
Inhibiting all MAJOR-MODE-hook functions (to fix #3660) would mean inhibiting some useful functionality, like indentation or syntax highlighting modes. We only want to inhibit expensive hooks. Since Doom adds these to MAJOR-MODE-local-vars-hook by convention, we can selectively inhibit those instead.
This commit is contained in:
@@ -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)))
|
||||
|
||||
|
Reference in New Issue
Block a user