mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
refactor: remove load suffix hacks
The lexical bindings for the load suffix variables in early-init.el does this work already, so affecting the global state of these variables is redundant and overkill.
This commit is contained in:
14
lisp/doom.el
14
lisp/doom.el
@ -467,20 +467,6 @@ users).")
|
||||
(doom-partial #'tty-run-terminal-initialization
|
||||
(selected-frame) nil t))))
|
||||
|
||||
;; PERF: `load-suffixes' and `load-file-rep-suffixes' are consulted on each
|
||||
;; `require' and `load'. Doom won't load any modules this early, so I omit
|
||||
;; *.so for a tiny startup boost. Is later restored in `doom-start'.
|
||||
(put 'load-suffixes 'initial-value (default-toplevel-value 'load-suffixes))
|
||||
(put 'load-file-rep-suffixes 'initial-value (default-toplevel-value 'load-file-rep-suffixes))
|
||||
(set-default-toplevel-value 'load-suffixes '(".elc" ".el"))
|
||||
(set-default-toplevel-value 'load-file-rep-suffixes '(""))
|
||||
;; COMPAT: Undo any problematic startup optimizations eventually, to prevent
|
||||
;; incompatibilities with anything loaded in userland.
|
||||
(add-hook! 'doom-before-init-hook
|
||||
(defun doom--reset-load-suffixes-h ()
|
||||
(setq load-suffixes (get 'load-suffixes 'initial-value)
|
||||
load-file-rep-suffixes (get 'load-file-rep-suffixes 'initial-value))))
|
||||
|
||||
;; These optimizations are brittle, difficult to debug, and obscure other
|
||||
;; issues, so bow out when debug mode is on.
|
||||
(unless init-file-debug
|
||||
|
Reference in New Issue
Block a user