diff --git a/early-init.el b/early-init.el index cb55169..2db483c 100644 --- a/early-init.el +++ b/early-init.el @@ -5,7 +5,19 @@ ;;; Code: -(setq gc-cons-threshold (* 8 5000 5000)) +;; blame @chke@emacs.ch if this no worky +(defvar mir/default-gc-thresh gc-cons-threshold) +(defun max-gc-thresh () + (setq gc-cons-threshold most-positive-fixnum)) +(max-gc-thresh) +(defun restore-gc-thresh () + (setq gc-cons-threshold mir/default-gc-thresh)) +(add-hook 'minibuffer-setup-hook #'max-gc-thresh) +(add-hook 'minibuffer-exit-hook #'restore-gc-thresh) +(add-hook 'elpaca-after-init-hook #'restore-gc-thresh) +(setq gc-cons-percentage 0.5) +(run-with-idle-timer 5 t #'garbage-collect) +(setq garbage-collection-messages t) (defun display-startup-echo-area-message () "A re-definition of the function. @@ -22,9 +34,6 @@ instead of the banal ")) -;; Crash the computer by overloading memory -(setq gc-cons-threshold (* 50 1000 1000)) - ;; Disable package.el so we can use straight (setq package-enable-at-startup nil) (defvar use-package-verbose nil) diff --git a/init.el b/init.el index 80def73..e773b4f 100644 --- a/init.el +++ b/init.el @@ -306,7 +306,7 @@ If the current window occupies the whole frame, split it." (elpaca compat) (elpaca marginalia (marginalia-mode)) -(elpaca gcmh (gcmh-mode)) +;; (elpaca gcmh (gcmh-mode)) (elpaca page-break-lines (add-hook 'emacs-lisp-mode-hook #'page-break-lines-mode)) (elpaca rainbow-mode @@ -331,8 +331,4 @@ If the current window occupies the whole frame, split it." ;; Don't barf out emacs errors as they are encountered (setq debug-on-error nil) -;; lower gc threshold again -(setq gc-cons-threshold (* 2 100 1000)) -;; (add-function :before #'after-focus-change-function #'garbage-collect) - ;;; init.el ends here