>From b1c40cdeac3bf806a140bbc527604163d1818468 Mon Sep 17 00:00:00 2001 From: Allen Li Date: Sun, 16 Feb 2020 23:15:35 -0800 Subject: [PATCH 3/3] Make recentf-auto-cleanup repeat when set to string * lisp/recentf.el (recentf-auto-cleanup): Make timer repeat, update docstring * etc/NEWS: Update news --- etc/NEWS | 7 +++++++ lisp/recentf.el | 12 +++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 1f8e6049a8..b79d4f8fb8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -146,6 +146,13 @@ key binding / v package-menu-filter-by-version / / package-menu-filter-clear +** 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. + * New Modes and Packages in Emacs 28.1 diff --git a/lisp/recentf.el b/lisp/recentf.el index 9c4ef21b52..dd8c2135e8 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -245,13 +245,10 @@ recentf-auto-cleanup - 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, cleanup is only scheduled once each -time the mode is turned on; it does not repeat daily. -Furthermore, the time is for the current day. If it is already -past the specified time for the day, cleanup happens immediately -as for `mode'. +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]. @@ -377,7 +374,8 @@ 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 ;; -- 2.25.0