From e8468ca32abba8539679f87c6def3bd54d8fd796 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 2 Jan 2021 16:03:46 -0600 Subject: Add garbage collect magic hack --- config.org | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config.org b/config.org index c444638..f523266 100644 --- a/config.org +++ b/config.org @@ -628,6 +628,21 @@ Commented for now because I really need to figure out the keybindings I want to (global-set-key (kbd "M-/") #'hippie-expand) #+end_src +*** Garbage collection + + #+begin_src emacs-lisp + (straight-use-package 'gcmh) + (gcmh-mode +1) + + (defun dotfiles--gc-on-last-frame-out-of-focus () + "GC if all frames are inactive." + (if (seq-every-p #'null (mapcar #'frame-focus-state (frame-list))) + (garbage-collect))) + + (add-function :after after-focus-change-function + #'dotfiles--gc-on-last-frame-out-of-focus) + #+end_src + ** Keyboard *** =ESC= cancels all -- cgit 1.4.1-21-gabe81