mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
perf: suppress local-vars hooks in temp buffers
Doom inserts some expensive hooks in MODE-local-vars-hook, like triggering LSP servers, tree-sitter, or visual enhancements -- things that are unnecessary in temporary (invisible) buffers, so I suppress them altogether there.
This commit is contained in:
@ -163,7 +163,12 @@
|
||||
|
||||
(defun doom-run-local-var-hooks-h ()
|
||||
"Run MODE-local-vars-hook after local variables are initialized."
|
||||
(unless (or doom-inhibit-local-var-hooks delay-mode-hooks)
|
||||
(unless (or doom-inhibit-local-var-hooks
|
||||
delay-mode-hooks
|
||||
;; Don't trigger local-vars hooks in temporary (internal) buffers
|
||||
(string-prefix-p
|
||||
" " (buffer-name (or (buffer-base-buffer)
|
||||
(current-buffer)))))
|
||||
(setq-local doom-inhibit-local-var-hooks t)
|
||||
(doom-run-hooks (intern-soft (format "%s-local-vars-hook" major-mode)))))
|
||||
|
||||
|
Reference in New Issue
Block a user