From 897916633e1ce006b20fc0af9f3b23fba27dbecb Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 15 May 2024 15:47:58 +0200 Subject: emacs: re-add gc optimisation settings --- user/emacs/init.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'user') diff --git a/user/emacs/init.el b/user/emacs/init.el index a0f77610..a17517ac 100644 --- a/user/emacs/init.el +++ b/user/emacs/init.el @@ -1,7 +1,17 @@ ;;; init --- user init file -*- lexical-binding: t; -*- (eval '(setq inhibit-startup-echo-area-message "alan")) (defvar default-file-name-handler-alist file-name-handler-alist) -(setq file-name-handler-alist nil) +(setq file-name-handler-alist nil + gc-cons-threshold most-positive-fixnum + gc-cons-percentage 0.6) +(defun set-max-gc-cons () + (setq gc-cons-threshold most-positive-fixnum)) +(defun set-default-gc-cons () + (setq gc-cons-threshold (* 16 1024 1024) + gc-cons-percentage 0.1)) +(add-hook 'minibuffer-setup-hook #'set-max-gc-cons) +(add-hook 'minibuffer-exit-hook #'set-default-gc-cons) +(add-hook 'after-init-hook #'set-default-gc-cons) (defun restore-file-name-handler-alist () (setq file-name-handler-alist default-file-name-handler-alist)) -- cgit 1.4.1