Configure garbage collection
This commit is contained in:
parent
5247b85a84
commit
63555d7365
15
init.el
15
init.el
|
@ -371,6 +371,21 @@
|
|||
(acdw/set '((disabled-command-function nil)
|
||||
(load-prefer-newer t)
|
||||
(comp-async-report-warnings-errors nil)))
|
||||
|
||||
(fset 'yes-or-no-p #'y-or-n-p)
|
||||
|
||||
;; Garbage collection
|
||||
(defun hook--gc-cons-maximize ()
|
||||
(setq gc-cons-threshold most-positive-fixnum))
|
||||
(add-hook 'minibuffer-setup-hook #'hook--gc-cons-maximize)
|
||||
|
||||
(defun hook--gc-cons-baseline ()
|
||||
(setq gc-cons-threshold gc-cons-threshold-basis))
|
||||
(add-hook 'minibuffer-exit-hook #'hook--gc-cons-baseline)
|
||||
|
||||
(defun hook--gc-when-unfocused ()
|
||||
(acdw/when-unfocused #'garbage-collect))
|
||||
(add-function :after after-focus-change-function
|
||||
#'hook--gc-when-unfocused)
|
||||
|
||||
;;; init.el ends here
|
||||
|
|
Loading…
Reference in New Issue