]> git.eshelyaron.com Git - emacs.git/commitdiff
recentf.el: Add verbosity option
authorLockywolf <for_emacs-recentf-patch_2023-12-21@lockywolf.net>
Thu, 13 Feb 2025 03:51:50 +0000 (11:51 +0800)
committerEshel Yaron <me@eshelyaron.com>
Sun, 23 Feb 2025 08:16:04 +0000 (09:16 +0100)
* lisp/recentf.el (recentf-show-messages): New defcustom to
control verbosity.
(recentf-save-list): Use that to control verbosity.  (Bug#67946)

(cherry picked from commit ce28916282800b2e4a5f8e244616e25f9e81831a)

lisp/recentf.el

index 611a8ee1844434252042ab14e5f165713c9703ee..9ee576c5c992584adcbd11c3cad3ed3c10e16924 100644 (file)
@@ -321,6 +321,14 @@ If non-nil, `recentf-open-files' will show labels for keys that can be
 used as shortcuts to open the Nth file."
   :group 'recentf
   :type 'boolean)
+
+(defcustom recentf-show-messages t
+  "Whether to show verbose messages about low-level recentf actions.
+nil means to not show messages related to the recentf machinery.
+t means show messages that were printed by default on Emacs <= 31.1."
+  :group 'recentf
+  :type 'boolean
+  :version "31.1")
 \f
 ;;; Utilities
 ;;
@@ -1344,8 +1352,12 @@ Write data into the file specified by `recentf-save-file'."
         (insert "\n\f\n;; Local Variables:\n"
                 (format ";; coding: %s\n" recentf-save-file-coding-system)
                 ";; End:\n")
-        (write-region (point-min) (point-max)
-                      (expand-file-name recentf-save-file))
+        (write-region (point-min)
+                      (point-max)
+                      (expand-file-name recentf-save-file) nil
+                      (unless (or (called-interactively-p 'interactive)
+                                 recentf-show-messages)
+                        'quiet))
         (when recentf-save-file-modes
           (set-file-modes recentf-save-file recentf-save-file-modes))
         nil)