diff options
author | Amin Bandali <bandali@kelar.org> | 2024-03-30 23:58:30 -0400 |
---|---|---|
committer | Amin Bandali <bandali@kelar.org> | 2024-03-30 23:58:30 -0400 |
commit | 293c1d450363105f714316a01d9462eda7a9f99f (patch) | |
tree | 716d5e920b1c83e9709ce377c5bb52f49b260e33 | |
parent | 8924718c097dbcd4ae3f9a5c2e7a5e2bdb693233 (diff) | |
download | configs-293c1d450363105f714316a01d9462eda7a9f99f.tar.gz configs-293c1d450363105f714316a01d9462eda7a9f99f.tar.xz configs-293c1d450363105f714316a01d9462eda7a9f99f.zip |
Add a few Emacs initialization customizations
Diffstat (limited to '')
-rw-r--r-- | .emacs.d/init.el | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 34b1bc9..6e038d4 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -34,6 +34,30 @@ ;;; Code: +;;; Emacs initialization + +;; Temporarily increase `gc-cons-threshhold' and `gc-cons-percentage' +;; during startup to reduce garbage collection frequency. Clearing +;; `file-name-handler-alist' seems to help reduce startup time too. +(defconst b/gc-cons-threshold gc-cons-threshold) +(defconst b/gc-cons-percentage gc-cons-percentage) +(defvar b/file-name-handler-alist file-name-handler-alist) +(setq gc-cons-threshold (* 30 1024 1024) ; 30 MiB + gc-cons-percentage 0.6 + file-name-handler-alist nil + ;; sidesteps a bug when profiling with esup + esup-child-profile-require-level 0) + +;; Set them back to their defaults once we're done initializing. +(defun b/post-init () + "My post-initialize function, run after loading `user-init-file'." + (setq + b/emacs-initialized t + gc-cons-threshold b/gc-cons-threshold + gc-cons-percentage b/gc-cons-percentage + file-name-handler-alist b/file-name-handler-alist)) +(add-hook 'after-init-hook #'b/post-init) + ;; whoami (setq user-full-name "Amin Bandali" user-mail-address "bandali@kelar.org") @@ -678,9 +702,10 @@ for all frames." (add-to-list 'savehist-additional-variables 'kill-ring)) ;; Automatically save place in files. +(setq save-place-file (b/var "save-place.el")) (run-with-idle-timer 0.2 nil #'require 'saveplace nil 'noerror) (with-eval-after-load 'saveplace - (setq save-place-file (b/var "save-place.el")) + ;; (setq save-place-file (b/var "save-place.el")) (save-place-mode)) (add-to-list 'auto-mode-alist '("\\.*rc$" . conf-mode)) |