emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d460677: Make recentf daily cleanup repeat


From: Lars Ingebrigtsen
Subject: master d460677: Make recentf daily cleanup repeat
Date: Thu, 1 Oct 2020 14:53:37 -0400 (EDT)

branch: master
commit d460677b19299fd43fa3a088895a406f9975a3ee
Author: Allen Li <darkfeline@felesatra.moe>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make recentf daily cleanup repeat
    
    * lisp/recentf.el (recentf-auto-cleanup): Fix wording.
    * lisp/recentf.el (recentf-auto-cleanup): Make timer repeat,
    update docstring.
    * etc/NEWS: Update news (bug#39638).
---
 etc/NEWS        |  7 +++++++
 lisp/recentf.el | 10 +++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index b4f29ab..43a99af 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -152,6 +152,13 @@ your init file:
     (setq frame-title-format '(multiple-frames "%b"
                               ("" invocation-name "@" system-name)))
 
+** recentf
+
+---
+*** 'recentf-auto-cleanup' time string now repeats.
+When 'recentf-auto-cleanup' is set to a time string, it now repeats
+every day, rather than only running once after the mode is turned on.
+
 
 * Editing Changes in Emacs 28.1
 
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 877edd4..61c39de 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -245,7 +245,10 @@ The following values can be set:
 - A number
     Cleanup each time Emacs has been idle that number of seconds.
 - A time string
-    Cleanup at specified time string, for example at \"11:00pm\".
+    Cleanup at specified time string daily, for example at \"11:00pm\".
+
+If a time string is provided and it is already past the specified time
+for the current day, the first cleanup happens immediately as for `mode'.
 
 Setting this variable directly does not take effect;
 use \\[customize].
@@ -257,7 +260,7 @@ cleanup the list."
                         :value mode)
                 (const  :tag "Never"
                         :value never)
-                (number :tag "When idle that seconds"
+                (number :tag "When idle after (seconds)"
                         :value 300)
                 (string :tag "At time"
                         :value "11:00pm"))
@@ -371,7 +374,8 @@ See also the option `recentf-auto-cleanup'.")
              recentf-auto-cleanup t 'recentf-cleanup))
            ((stringp recentf-auto-cleanup)
             (run-at-time
-             recentf-auto-cleanup nil 'recentf-cleanup))))))
+             ;; Repeat every 24 hours.
+             recentf-auto-cleanup (* 24 60 60) 'recentf-cleanup))))))
 
 ;;; File functions
 ;;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]