From 9c4ceb9015e70fda894aa1d68f1b39ace4cded86 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 1 Nov 2025 12:57:49 -0500 Subject: 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`. --- modules/system-defaults.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/system-defaults.el b/modules/system-defaults.el index 52607121..715dcda6 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) -- cgit v1.2.3