mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-19 13:43:36 -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:
@@ -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))
|
||||
|
||||
|
Reference in New Issue
Block a user