Commit fc9b96ed7782

Vincent Demeester <vincent@sbr.pm>
2020-02-27 19:02:36
Document recentf configuration ♻
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent ab29f0e
Changed files (2)
config/00-clean.el
@@ -1,10 +1,8 @@
 (use-package recentf
-  :custom
-  (recentf-max-menu-items 15)
-  (recentf-max-saved-items 200)
-  (recentf-auto-cleanup 360)
-  (recentf-show-file-shortcuts-flag nil)
   :config
+  (setq recentf-max-saved-items 200
+        recentf-auto-cleanup 360
+        recentf-show-file-shortcuts-flag nil)
   (recentf-mode 1)
   (add-to-list 'recentf-exclude "^/\\(?:ssh\\|su\\|sudo\\)?:")
   ;; Magic advice to rename entries in recentf when moving files in
@@ -35,15 +33,7 @@
                   recentf-list))
     recentf-cleanup)
 
-  (advice-add 'dired-rename-file :after #'rjs/recentf-rename-notify)
-
-  (defun contrib/recentf-add-dired-directory ()
-    "Include Dired buffers in the list.  Particularly useful when
-combined with a completion framework's ability to display virtual
-buffers."
-    (when (and (stringp dired-directory)
-               (equal "" (file-name-nondirectory dired-directory)))
-      (recentf-add-file dired-directory))))
+  (advice-add 'dired-rename-file :after #'rjs/recentf-rename-notify))
 
 (use-package no-littering               ; Keep .emacs.d clean
   :config
emacs.org
@@ -496,16 +496,24 @@
 color-theme; a "path-theme" if you will.
 #+end_quote
 
-Let's configure it *and* make sure we load it as soon as possible (hence the =config/00-clean.el=)
+Let's configure it *and* make sure we load it as soon as possible (hence the
+=config/00-clean.el=).
+
+As I am loading =recentf= during this cleanup part, I need to setup recentf before 😅. In
+a gist:
+
+- I keep about 200 items.
+- I don't want the /auto-cleanup/ of recentf items to happen when the mode is loaded (a.k.a.
+  at startup). It is configured to run after 360s of idle time.
+- I don't really want to show the Nth number of the items.
+- I don't want recentf to save remote, =su= and =sudo= items (=ssh:=, =sudo:=, …)
 
 #+begin_src emacs-lisp
 (use-package recentf
-  :custom
-  (recentf-max-menu-items 15)
-  (recentf-max-saved-items 200)
-  (recentf-auto-cleanup 360)
-  (recentf-show-file-shortcuts-flag nil)
   :config
+  (setq recentf-max-saved-items 200
+        recentf-auto-cleanup 360
+        recentf-show-file-shortcuts-flag nil)
   (recentf-mode 1)
   (add-to-list 'recentf-exclude "^/\\(?:ssh\\|su\\|sudo\\)?:")
   ;; Magic advice to rename entries in recentf when moving files in
@@ -536,15 +544,7 @@
                   recentf-list))
     recentf-cleanup)
 
-  (advice-add 'dired-rename-file :after #'rjs/recentf-rename-notify)
-
-  (defun contrib/recentf-add-dired-directory ()
-    "Include Dired buffers in the list.  Particularly useful when
-combined with a completion framework's ability to display virtual
-buffers."
-    (when (and (stringp dired-directory)
-               (equal "" (file-name-nondirectory dired-directory)))
-      (recentf-add-file dired-directory))))
+  (advice-add 'dired-rename-file :after #'rjs/recentf-rename-notify))
 
 (use-package no-littering               ; Keep .emacs.d clean
   :config