summary refs log tree commit diff stats
path: root/user/emacs
diff options
context:
space:
mode:
authorAlan Pearce2023-06-21 12:58:07 +0200
committerAlan Pearce2023-06-21 12:58:07 +0200
commit8f47d540ce6b1b56aebfa427e9f7d2d7e44e9bb4 (patch)
tree5c8849327f1e0fd3b71c81e96298fbca9745b181 /user/emacs
parent77f8d0771b0bd36dcbca9e61fc88ba9dc7d7b4b9 (diff)
downloadnixfiles-8f47d540ce6b1b56aebfa427e9f7d2d7e44e9bb4.tar.lz
nixfiles-8f47d540ce6b1b56aebfa427e9f7d2d7e44e9bb4.tar.zst
nixfiles-8f47d540ce6b1b56aebfa427e9f7d2d7e44e9bb4.zip
Emacs: collect gc stats for a while
Diffstat (limited to 'user/emacs')
-rw-r--r--user/emacs/init.el17
1 files changed, 6 insertions, 11 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el
index 8cb4b77c..88730f1e 100644
--- a/user/emacs/init.el
+++ b/user/emacs/init.el
@@ -1,17 +1,7 @@
 ;;; init --- user init file  -*- lexical-binding: t; -*-
 (eval '(setq inhibit-startup-echo-area-message "alan"))
 (defvar default-file-name-handler-alist file-name-handler-alist)
-(setq gc-cons-threshold most-positive-fixnum
-      gc-cons-percentage 0.6
-      file-name-handler-alist nil)
-(defun set-max-gc-cons ()
-  (setq gc-cons-threshold most-positive-fixnum))
-(defun set-default-gc-cons ()
-  (setq gc-cons-threshold (* 16 1024 1024)
-        gc-cons-percentage 0.1))
-(add-hook 'minibuffer-setup-hook #'set-max-gc-cons)
-(add-hook 'minibuffer-exit-hook #'set-default-gc-cons)
-(add-hook 'after-init-hook #'set-default-gc-cons)
+(setq file-name-handler-alist nil)
 
 (defun restore-file-name-handler-alist ()
   (setq file-name-handler-alist default-file-name-handler-alist))
@@ -55,6 +45,11 @@
             (when (eq system-type 'darwin)
               (general-unbind "s-x"))))
 
+(use-package emacs-gc-stats
+  :config (progn
+            (setq emacs-gc-stats-gc-defaults 'emacs-defaults)
+            (emacs-gc-stats-mode +1)))
+
 ;;; Styles
 
 ;; I prefer an always-visible cursor.  Feels less distracting.