emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 86ebc88cd8: Fix gnus-search-run-search methods


From: Eric Abrahamsen
Subject: master 86ebc88cd8: Fix gnus-search-run-search methods
Date: Fri, 18 Feb 2022 00:29:45 -0500 (EST)

branch: master
commit 86ebc88cd8e54c6013c458c513cd21510942d133
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Fix gnus-search-run-search methods
    
    * lisp/gnus/gnus-search.el (gnus-search-run-search): Both these
    implementations were setting the current buffer and then not setting
    it back.
---
 lisp/gnus/gnus-search.el | 40 +++++++++++++++++++---------------------
 1 file changed, 19 insertions(+), 21 deletions(-)

diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index 1e927ca922..ec4dc4cf50 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -1346,16 +1346,14 @@ This method is common to all indexed search engines.
 
 Returns a list of [group article score] vectors."
 
-  (save-excursion
-    (let* ((qstring (gnus-search-make-query-string engine query))
-          (program (slot-value engine 'program))
-          (buffer (slot-value engine 'proc-buffer))
-          (cp-list (gnus-search-indexed-search-command
-                    engine qstring query groups))
-           proc exitstatus)
-      (set-buffer buffer)
+  (let* ((qstring (gnus-search-make-query-string engine query))
+        (program (slot-value engine 'program))
+        (buffer (slot-value engine 'proc-buffer))
+        (cp-list (gnus-search-indexed-search-command
+                  engine qstring query groups))
+         proc exitstatus)
+    (with-current-buffer buffer
       (erase-buffer)
-
       (if groups
          (gnus-message 7 "Doing %s query on %s..." program groups)
        (gnus-message 7 "Doing %s query..." program))
@@ -1374,7 +1372,7 @@ Returns a list of [group article score] vectors."
        ;; wants it.
        (when (> gnus-verbose 6)
          (display-buffer buffer))
-       nil))))
+        nil))))
 
 (cl-defmethod gnus-search-indexed-parse-output ((engine gnus-search-indexed)
                                                server query &optional groups)
@@ -1628,17 +1626,17 @@ Namazu provides a little more information, for instance 
a score."
               (cp-list (gnus-search-indexed-search-command
                         engine qstring query groups))
               thread-ids proc)
-         (set-buffer proc-buffer)
-         (erase-buffer)
-         (setq proc (apply #'start-process (format "search-%s" server)
-                           proc-buffer program cp-list))
-         (while (process-live-p proc)
-           (accept-process-output proc))
-          (goto-char (point-min))
-         (while (re-search-forward
-                  "^thread:\\([^[:space:]\n]+\\)"
-                  (point-max) t)
-           (cl-pushnew (match-string 1) thread-ids :test #'equal))
+         (with-current-buffer proc-buffer
+           (erase-buffer)
+           (setq proc (apply #'start-process (format "search-%s" server)
+                             proc-buffer program cp-list))
+           (while (process-live-p proc)
+             (accept-process-output proc))
+            (goto-char (point-min))
+           (while (re-search-forward
+                    "^thread:\\([^[:space:]\n]+\\)"
+                    (point-max) t)
+             (cl-pushnew (match-string 1) thread-ids :test #'equal)))
          (cl-call-next-method
           engine server
           ;; If we found threads, completely replace the query with



reply via email to

[Prev in Thread] Current Thread [Next in Thread]