diff options
Diffstat (limited to 'init.el')
-rw-r--r-- | init.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/init.el b/init.el index 86eb548..c316588 100644 --- a/init.el +++ b/init.el | |||
@@ -371,6 +371,21 @@ | |||
371 | (acdw/set '((disabled-command-function nil) | 371 | (acdw/set '((disabled-command-function nil) |
372 | (load-prefer-newer t) | 372 | (load-prefer-newer t) |
373 | (comp-async-report-warnings-errors nil))) | 373 | (comp-async-report-warnings-errors nil))) |
374 | |||
374 | (fset 'yes-or-no-p #'y-or-n-p) | 375 | (fset 'yes-or-no-p #'y-or-n-p) |
375 | 376 | ||
377 | ;; Garbage collection | ||
378 | (defun hook--gc-cons-maximize () | ||
379 | (setq gc-cons-threshold most-positive-fixnum)) | ||
380 | (add-hook 'minibuffer-setup-hook #'hook--gc-cons-maximize) | ||
381 | |||
382 | (defun hook--gc-cons-baseline () | ||
383 | (setq gc-cons-threshold gc-cons-threshold-basis)) | ||
384 | (add-hook 'minibuffer-exit-hook #'hook--gc-cons-baseline) | ||
385 | |||
386 | (defun hook--gc-when-unfocused () | ||
387 | (acdw/when-unfocused #'garbage-collect)) | ||
388 | (add-function :after after-focus-change-function | ||
389 | #'hook--gc-when-unfocused) | ||
390 | |||
376 | ;;; init.el ends here | 391 | ;;; init.el ends here |