From 165f7622a64908ea9df7b01f2865edd68add1cd6 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 30 Dec 2021 23:08:10 -0600 Subject: Speed up init --- early-init.el | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/early-init.el b/early-init.el index 1683e54..7c39f5b 100644 --- a/early-init.el +++ b/early-init.el @@ -21,10 +21,24 @@ ;;; Code: -;; Message when loading a library. This is the only place I'm going to use a -;; `defadvice', and only because it's cleaner than defining a nonce function. -(defadvice load (before debug-log activate) - (message "Now loading: '%s'" (ad-get-arg 0))) +;; Message when loading a library. +(define-advice load (:before (feature &rest _)) + (message "Now loading: '%s'" feature)) + +;;; Speed up init + +(setq gc-cons-threshold most-positive-fixnum) + +(add-hook 'emacs-startup-hook + (defun emacs-startup@restore-values () + "Restore values set during early-init for speed." + (setq gc-cons-threshold 134217728 ; 128mb + ;; I don't do the common `file-name-handler-alist' thing here + ;; because of a weirdness where my Emacs doesn't know how to + ;; load bookmark.el.gz when initializing. + ))) + +;;; Set up extra load paths and functionality (push (locate-user-emacs-file "lisp") load-path) (add-to-list 'load-path (locate-user-emacs-file "lisp/compat") :append) @@ -53,6 +67,7 @@ See `no-littering' for examples.") (bottom . right))) ;; Fonts + (let ((font-name "Go Mono") (font-size 105) (variable-font-name "Go") -- cgit 1.4.1-21-gabe81