From 6b901a8e85987940738b21032b035ba4e8f7379b Mon Sep 17 00:00:00 2001 From: shipmints Date: Thu, 20 Mar 2025 12:53:09 -0400 Subject: [PATCH] Strip text properties on recentf entries, when saved (bug#77140) Text properties are added by common completion frameworks, and serve no purpose when stored in 'recentf-save-file', waste space, and slow loading the file. * lisp/recentf.el (recentf-dump-variable): Process string values through 'substring-no-properties'. --- lisp/recentf.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/recentf.el b/lisp/recentf.el index 3e0c2dfd508..a773ea9ec01 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -310,10 +310,10 @@ They are successively passed a file name to transform it." :type '(choice (const :tag "None" nil) (repeat :tag "Functions" - (choice - (const file-truename) - (const abbreviate-file-name) - (function :tag "Other function")))) + (choice + (const file-truename) + (const abbreviate-file-name) + (function :tag "Other function")))) :version "29.1") (defcustom recentf-show-file-shortcuts-flag t @@ -372,7 +372,9 @@ the full list." (setq value (seq-take value limit))) (insert (format "\n(setq %S\n '(" variable)) (dolist (e value) - (insert (format "\n %S" e))) + (insert (format "\n %S" + (or (and (stringp e) (substring-no-properties e)) + e)))) (insert "\n ))\n")))) (defvar recentf-auto-cleanup-timer nil