Subject: bug#51778: 29.0.50; gnus-search uses `message' instead of `gnus-message'

From: "Jose A. Ortega Ruiz" <[email-masked]>
Date: Thu, 11 Nov 2021 21:59:15 +0000

Hi,

In gnus-search, there are several logs (some of them quite verbose when
one's iterating over long lists of groups) using `message'.  I think
that it'd be better to use `gnus-message' instead, with levels as
appropriate.  That way one can avoid (or enable!) them via gnus-verbose.

I'm attaching a patch changing them all to level 7, since they looked
like debug messages to me; but it's just a suggestion.

Thanks!
jao

>From 0ea1df942474f8decb71a71c7f2ed03d86ef8991 Mon Sep 17 00:00:00 2001
From: jao <[email-masked]>
Date: Thu, 11 Nov 2021 21:54:19 +0000
Subject: [PATCH] Use gnus-message for logging in gnus-search

---
 lisp/gnus/gnus-search.el | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index 3157358804..a4d319b4b8 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -1018,7 +1018,7 @@ gnus-search-run-search
 	  (single-search (gnus-search-single-p query))
 	  (grouplist (or groups (gnus-search-get-active srv)))
 	  q-string artlist group)
-      (message "Opening server %s" server)
+      (gnus-message 7 "Opening server %s" server)
       (gnus-open-server srv)
       ;; We should only be doing this once, in
       ;; `nnimap-open-connection', but it's too frustrating to try to
@@ -1062,7 +1062,7 @@ gnus-search-run-search
 	(when (nnimap-change-group
 	       (gnus-group-short-name group) server)
 	  (with-current-buffer (nnimap-buffer)
-	    (message "Searching %s..." group)
+	    (gnus-message 7 "Searching %s..." group)
 	    (let ((result
 		   (gnus-search-imap-search-command engine q-string)))
 	      (when (car result)
@@ -1075,7 +1075,7 @@ gnus-search-run-search
 			      (vector group artn 100))))
 			(cdr (assoc "SEARCH" (cdr result))))
 		       artlist))))
-	    (message "Searching %s...done" group))))
+	    (gnus-message 7 "Searching %s...done" group))))
       (nreverse artlist))))
 
 (cl-defmethod gnus-search-imap-search-command ((engine gnus-search-imap)
@@ -1330,8 +1330,8 @@ gnus-search-run-search
       (erase-buffer)
 
       (if groups
-	  (message "Doing %s query on %s..." program groups)
-	(message "Doing %s query..." program))
+	  (gnus-message 7 "Doing %s query on %s..." program groups)
+	(gnus-message 7 "Doing %s query..." program))
       (setq proc (apply #'start-process (format "search-%s" server)
 			buffer program cp-list))
       (while (process-live-p proc)
@@ -1837,8 +1837,8 @@ gnus-search-run-search
      (mapcar (lambda (x)
 	       (let ((group x)
 		     artlist)
-		 (message "Searching %s using find-grep..."
-			  (or group server))
+		 (gnus-message 7 "Searching %s using find-grep..."
+                               (or group server))
 		 (save-window-excursion
 		   (set-buffer buffer)
 		   (if (> gnus-verbose 6)
@@ -1893,8 +1893,8 @@ gnus-search-run-search
 			  (vector (gnus-group-full-name group server) art 0)
 			  artlist))
 		       (forward-line 1)))
-		   (message "Searching %s using find-grep...done"
-			    (or group server))
+		   (gnus-message 7 "Searching %s using find-grep...done"
+			         (or group server))
 		   artlist)))
 	     grouplist))))
 
-- 
2.33.1