diff --git a/etc/NEWS b/etc/NEWS index 1ff2f8a149f..9bc58e790f5 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1046,7 +1046,11 @@ desktop restoration to continue. Similarly to buffer restoration by Desktop, 'recentf-mode' checking of the accessibility of remote files can now time out if 'remote-file-name-access-timeout' is set to a positive number. - +*** New use option 'recentf-verbose'. +By default 'recentf-save-list' prints a message when saving the +recentf list. The new option, if set to nil, suppresses this message. +If more debugging info suppression switches are to be added, this +option might become more useful. ** Notifications +++ diff --git a/lisp/recentf.el b/lisp/recentf.el index 94ae871763b..616bd373232 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -319,6 +319,13 @@ recentf-show-file-shortcuts-flag used as shortcuts to open the Nth file." :group 'recentf :type 'boolean) + +(defcustom recentf-verbose 1 + "0 means to not show debugging messages related to the recentf machinery. +1 means show messages that were printed by default on Emacs <= 29.1." + :group 'recentf + :type 'integer + :version "30.1") ;;; Utilities ;; @@ -1324,7 +1331,12 @@ recentf-save-list (format ";; coding: %s\n" recentf-save-file-coding-system) ";; End:\n") (write-region (point-min) (point-max) - (expand-file-name recentf-save-file)) + (expand-file-name recentf-save-file) + nil + (if (= recentf-verbose 1) + nil ;; show "Wrote ..." messages. + 1) ;; non-nil, non-t, non-string, do not show. + ) (when recentf-save-file-modes (set-file-modes recentf-save-file recentf-save-file-modes)) nil)