From 1b826fa80f6d5a1bf01477a1cebd44c2c5bace89 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 6 Nov 2024 05:56:32 -0500 Subject: [PATCH] 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. --- lisp/doom.el | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lisp/doom.el b/lisp/doom.el index 22e9b7996..b7c9dd058 100644 --- a/lisp/doom.el +++ b/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