diff --git a/init.org b/init.org index 25eaf35..205b1f8 100644 --- a/init.org +++ b/init.org @@ -3493,11 +3493,13 @@ But with =initials=, the desired completion is often buried in the results. That ** recentf #+BEGIN_SRC emacs-lisp (use-package recentf - :init (recentf-mode 1) + :init + ;; default is to cleanup when `recentf-mode' is enabled, which we don't want + (setq recentf-auto-cleanup 'never) + (recentf-mode 1) :bind ("C-x C-r C-o" . recentf-open-files) :config - (setq recentf-auto-cleanup 'never - recentf-max-menu-items 500 + (setq recentf-max-menu-items 500 recentf-max-saved-items 1000 recentf-save-file (locate-user-emacs-file "recentf") recentf-exclude '("\\.html\\(\\.orig\\)?$" @@ -3506,9 +3508,10 @@ But with =initials=, the desired completion is often buried in the results. That "\\.mp4$" "\\.etc" "\\.umstuff")) - ;; I'd rather run cleanup manually, if ever required; running this - ;; automatically is a recipe for periodically losing your recentf - ;; entries when your disk happens to be unmounted. + (advice-add 'recentf-save-list :before (lambda (&rest args) (async-backup recentf-save-file))) + ;; I'd rather run cleanup manually, if ever required; running + ;; cleanup automatically is a recipe for periodically losing your + ;; recentf entries when your disk happens to be unmounted. ;; :hook (kill-emacs . recentf-cleanup) ) #+END_SRC