aboutsummaryrefslogtreecommitdiff
path: root/modules/system-defaults.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-11-01 12:57:49 -0500
committerCraig Jennings <c@cjennings.net>2025-11-01 12:57:49 -0500
commit90cb36b61e25684caa82fec7074222a693b2ddcc (patch)
tree7af0a0f1658af557f02d2451d0635274a7278bcd /modules/system-defaults.el
parentdf2353afdd8d43ef141f4f591227224238151de8 (diff)
downloaddotemacs-90cb36b61e25684caa82fec7074222a693b2ddcc.tar.gz
dotemacs-90cb36b61e25684caa82fec7074222a693b2ddcc.zip
perf:system-defaults: Unpropertize kill ring on exit
Add `unpropertize-kill-ring` function to remove text properties from the kill ring when Emacs is exiting. This improves performance by reducing unnecessary data retention. The function is hooked into `kill-emacs-hook`.
Diffstat (limited to 'modules/system-defaults.el')
-rw-r--r--modules/system-defaults.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/system-defaults.el b/modules/system-defaults.el
index 526071216..715dcda6e 100644
--- a/modules/system-defaults.el
+++ b/modules/system-defaults.el
@@ -229,6 +229,13 @@ Used to disable functionality with defalias \='somefunc \='cj/disabled)."
(setq kept-new-versions 25) ;; keep 25 of the newest backups made (default: 2)
(setq vc-make-backup-files t) ;; also backup any files in version control
+;; ------------------ Unpropertize Kill Ring For Performance -----------------
+
+(defun unpropertize-kill-ring ()
+ (setq kill-ring (mapcar 'substring-no-properties kill-ring)))
+
+(add-hook 'kill-emacs-hook 'unpropertize-kill-ring)
+
;; ------------------------------- GNU 'ls' On BSD -------------------------------
(when (env-bsd-p)