Add docstrings to GC hooks

And correct grammar in a comment.
This commit is contained in:
Henrik Lissner 2019-10-18 22:08:22 -04:00
parent 2f4ac32b0d
commit 43e8ddbc6d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -267,11 +267,11 @@ users).")
;; To speed up minibuffer commands (like helm and ivy), we defer garbage
;; collection while the minibuffer is active.
(defun doom-defer-garbage-collection-h ()
"TODO"
"Increase `gc-cons-threshold' to stave off garbage collection."
(setq gc-cons-threshold most-positive-fixnum))
(defun doom-restore-garbage-collection-h ()
"TODO"
"Restore `gc-cons-threshold' to a reasonable value so the GC can do its job."
;; Defer it so that commands launched immediately after will enjoy the
;; benefits.
(run-at-time
@ -284,7 +284,7 @@ users).")
(add-hook 'emacs-startup-hook #'doom-restore-garbage-collection-h)
;; When Emacs loses focus seems like a great time to do some garbage collection
;; all sneaky breeky like, so we can return a fresh(er) Emacs.
;; all sneaky breeky like, so we can return to a fresh(er) Emacs.
(add-hook 'focus-out-hook #'garbage-collect)