4

I've configured Emacs to save recentf every five minutes by using this code:

(run-at-time nil (* 5 60) 'recentf-save-list)

It works great, but after writing recentf Emacs feels it has to tell me about it, so every 5 minutes I get a message in the minibuffer telling me it wrote recentf.

How do I silence that message?

Drew
  • 75,699
  • 9
  • 109
  • 225
izkon
  • 1,798
  • 10
  • 23

1 Answers1

9

One solution for that narrow case is to dynamically set save-silently for that invocation specific invocation. Try:

(run-at-time nil (* 5 60)
             (lambda ()
               (let ((save-silently t))
                 (recentf-save-list))))

You might alternatively use advice to globally accomplish the same thing. See Advising Functions in the Emacs Lisp Manual.

ebpa
  • 7,319
  • 26
  • 53
  • I had to also add `(inhibit-message t) to the let bindings as per https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-08/msg00364.html – ldeck Nov 16 '22 at 17:07