(Emacs/config|init)~cut my init time to just a second

I had a problem with after-init-hook which would (while supposedly
keeping (emacs-init-time) under 1.2 seconds) take ages to start emacs
just due to how many things were starting up using it.  So I removed
all the after-init-hook functions and instead aggressively demand the
stuff I need and defer everything else through ":defer", ":after",
":hook" and ":general".

Happy to say my boot time is now actually 1.2 seconds without
compilation.
This commit is contained in:
2024-05-13 17:01:24 +05:30
parent 8fcdfac661
commit 955f2a223c
2 changed files with 64 additions and 70 deletions

View File

@@ -27,6 +27,10 @@
;; possible.
(let ((gc-cons-threshold most-positive-fixnum))
;; Straight
(setq straight-disable-native-compile nil
straight-use-package-by-default nil
straight-check-for-modifications 'live)
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name
@@ -43,9 +47,7 @@
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(setq straight-disable-native-compile nil
straight-use-package-by-default t
use-package-enable-imenu-support t
(setq use-package-enable-imenu-support t
use-package-always-demand nil
use-package-always-defer nil
use-package-hook-name-suffix nil
@@ -74,6 +76,8 @@
(when (daemonp)
(require 'general)
(require 'evil)
(require 'ivy)
(require 'counsel)
(require 'notmuch)
(require 'company)
(require 'org)