From cdef3035a34ec921254be52c5522a86857172a89 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 2 Feb 2025 22:23:13 -0500 Subject: [PATCH] Update recentf options and add minimal-emacs--cleanup-hook --- init.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index dd2e61a..172fa34 100644 --- a/init.el +++ b/init.el @@ -211,7 +211,17 @@ ;; accessed files, making it easier to reopen files you have worked on ;; recently. (setq recentf-max-saved-items 300) ; default is 20 -(setq recentf-auto-cleanup 'mode) +(setq recentf-max-menu-items 15) +(setq recentf-auto-cleanup 'never) + +(defun minimal-emacs--cleanup-hook () + "Run `recentf-cleanup' if `recentf' is loaded and `recentf-mode' is enabled." + (when (and (featurep 'recentf) + recentf-mode + (fboundp 'recentf-cleanup)) + (recentf-cleanup))) + +(add-hook 'kill-emacs-hook #'minimal-emacs--cleanup-hook) ;;; saveplace ;; `save-place-mode` enables Emacs to remember the last location within a file