Minor optimization for init.el

The lazy-loaded version library and file-name-directory calls end up
consulting file-name-handler-alist, and can trigger the GC, so we ensure
these things happen after the other optimizations.
This commit is contained in:
Henrik Lissner 2019-09-03 00:43:25 -04:00
parent 62b089ba36
commit 58567b1345
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

18
init.el
View file

@ -27,13 +27,6 @@
;; ;;
;;; License: MIT ;;; License: MIT
(when (version< emacs-version "25.3")
(error "Detected Emacs %s. Doom only supports Emacs 25.3 and higher"
emacs-version))
;; Ensure Doom is running out of this file's directory
(setq user-emacs-directory (file-name-directory load-file-name))
;; A big contributor to startup times is garbage collection. We up the gc ;; A big contributor to startup times is garbage collection. We up the gc
;; threshold to temporarily prevent it from running, then reset it later with ;; threshold to temporarily prevent it from running, then reset it later with
;; `doom-restore-garbage-collection-h'. Not resetting it will cause ;; `doom-restore-garbage-collection-h'. Not resetting it will cause
@ -45,8 +38,17 @@
;; to skip the mtime checks on every *.elc file we load. ;; to skip the mtime checks on every *.elc file we load.
(setq load-prefer-newer noninteractive) (setq load-prefer-newer noninteractive)
(let (file-name-handler-alist)
(when (version< emacs-version "25.3")
(error "Detected Emacs %s. Doom only supports Emacs 25.3 and higher"
emacs-version))
;; Ensure Doom is running out of this file's directory
(setq user-emacs-directory (file-name-directory load-file-name)))
;; Load the heart of Doom Emacs ;; Load the heart of Doom Emacs
(require 'core (concat user-emacs-directory "core/core")) (load (concat user-emacs-directory "core/core")
nil 'nomessage)
;; And let 'er rip! ;; And let 'er rip!
(add-hook 'window-setup-hook #'doom-display-benchmark-h) (add-hook 'window-setup-hook #'doom-display-benchmark-h)