Last active
April 29, 2021 22:13
-
-
Save masutaka/1325654 to your computer and use it in GitHub Desktop.
a timer setting for recentf-mode without notifications to minibuffer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'cl) | |
(defvar my-recentf-list-prev nil) | |
(defadvice recentf-save-list | |
(around no-message activate) | |
"If `recentf-list' and previous recentf-list are equal, | |
do nothing. And suppress the output from `message' and | |
`write-file' to minibuffer." | |
(unless (equal recentf-list my-recentf-list-prev) | |
(cl-flet ((message (format-string &rest args) | |
(eval `(format ,format-string ,@args))) | |
(write-file (file &optional confirm) | |
(let ((str (buffer-string))) | |
(with-temp-file file | |
(insert str))))) | |
ad-do-it | |
(setq my-recentf-list-prev recentf-list)))) | |
(defadvice recentf-cleanup | |
(around no-message activate) | |
"suppress the output from `message' to minibuffer" | |
(cl-flet ((message (format-string &rest args) | |
(eval `(format ,format-string ,@args)))) | |
ad-do-it)) | |
(setq recentf-save-file (expand-file-name ".recentf" user-emacs-directory)) | |
(setq recentf-max-saved-items 2000) | |
(setq recentf-exclude '(".recentf")) | |
(setq recentf-auto-cleanup 10) | |
(run-with-idle-timer 30 t 'recentf-save-list) | |
(recentf-mode 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I posted the description to my blog.
http://masutaka.net/chalow/2011-10-30-2.html (Japanese version only)