Update recentf options and add minimal-emacs--cleanup-hook

This commit is contained in:
James Cherti
2025-02-02 22:23:13 -05:00
parent d04da86254
commit cdef3035a3

12
init.el
View File

@@ -211,7 +211,17 @@
;; accessed files, making it easier to reopen files you have worked on ;; accessed files, making it easier to reopen files you have worked on
;; recently. ;; recently.
(setq recentf-max-saved-items 300) ; default is 20 (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 ;;; saveplace
;; `save-place-mode` enables Emacs to remember the last location within a file ;; `save-place-mode` enables Emacs to remember the last location within a file