unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Vladimir Nikishkin <for_emacs-recentf-patch_2023-12-21@lockywolf.net>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 67946@debbugs.gnu.org
Subject: bug#67946: 30.0.50; [RFC PATCH] Add an option to not report "Wrote ..." when saving recentf.
Date: Tue, 26 Dec 2023 13:58:45 +0800	[thread overview]
Message-ID: <87plyt4i6k.fsf@laptop.lockywolf.net> (raw)
In-Reply-To: <CADwFkmk4W1TAFpsGnKv_QB8pu9iO1x4Y4xT2H=apmo3enq=jhQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 651 bytes --]


Stefan Kangas <stefankangas@gmail.com> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>> If we decide to turn it off, we will need a knob to revert to the old
>> behavior, because after so many years of the existing behavior,
>> someone somewhere might be used to it.
>
> I think the existing patch basically has that already, but it seems to
> be lacking a NEWS entry and a :version tag for the defcustom before it
> can go in.
>
> Vladimir, could you fix that and send a new patch?

Added an entry to etc/NEWS, and, seems, fixed the actual verbosity
message printing condition.

-- 
Your sincerely,
Vladimir Nikishkin (MiEr, lockywolf)
(Laptop)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 001_patch-recentf-verbose_v2.patch --]
[-- Type: text/x-patch, Size: 1846 bytes --]

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")
 \f
 ;;; 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)

  reply	other threads:[~2023-12-26  5:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21  3:26 bug#67946: 30.0.50; [RFC PATCH] Add an option to not report "Wrote ..." when saving recentf Vladimir Nikishkin
2023-12-21  9:37 ` Eli Zaretskii
2023-12-24 14:39 ` Stefan Kangas
2023-12-25  5:17   ` Vladimir Nikishkin
2023-12-25 12:25     ` Eli Zaretskii
2023-12-25 21:50       ` Stefan Kangas
2023-12-26  5:58         ` Vladimir Nikishkin [this message]
2023-12-26 12:41           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87plyt4i6k.fsf@laptop.lockywolf.net \
    --to=for_emacs-recentf-patch_2023-12-21@lockywolf.net \
    --cc=67946@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).