Don't EXAMINE a group if it's already selected.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 4 Nov 2010 20:07:01 +0000 (21:07 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Thu, 4 Nov 2010 20:07:01 +0000 (21:07 +0100)
lisp/ChangeLog
lisp/nnimap.el

index 93b87e9..288c1bd 100644 (file)
@@ -1,5 +1,8 @@
 2010-11-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * nnimap.el (nnimap-find-article-by-message-id): Don't EXAMINE a group
+       if it's already selected.
+
        * mm-decode.el (mm-save-part): Put the entire path in the `M-n' slot.
 
 2010-11-04  Katsumi Yamaoka  <yamaoka@jpl.org>
index ef7831c..65d5af9 100644 (file)
@@ -731,8 +731,6 @@ textual parts.")
       ;; to examine a mailbox that doesn't exist.  This seems to be
       ;; the only way that allows us to reliably go back to unselected
       ;; state on Courier.
-      (nnimap-command "EXAMINE DOES.NOT.EXIST")
-      (setf (nnimap-group nnimap-object) nil)
       (car (nnimap-command "RENAME %S %S"
                           (utf7-encode group t) (utf7-encode new-name t))))))
 
@@ -863,8 +861,9 @@ textual parts.")
 (defun nnimap-find-article-by-message-id (group message-id)
   (with-current-buffer (nnimap-buffer)
     (erase-buffer)
-    (setf (nnimap-group nnimap-object) nil)
-    (nnimap-send-command "EXAMINE %S" (utf7-encode group t))
+    (unless (equal group (nnimap-group nnimap-object))
+      (setf (nnimap-group nnimap-object) nil)
+      (nnimap-send-command "EXAMINE %S" (utf7-encode group t)))
     (let ((sequence
           (nnimap-send-command "UID SEARCH HEADER Message-Id %S" message-id))
          article result)