Unselect group before renaming. This had gotten lost somewhere.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 21 Nov 2010 05:07:59 +0000 (06:07 +0100)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 21 Nov 2010 05:07:59 +0000 (06:07 +0100)
lisp/ChangeLog
lisp/nnimap.el

index 9aba1f9..115fdbd 100644 (file)
@@ -1,3 +1,9 @@
+2010-11-21  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * nnimap.el (nnimap-unselect-group): Made into its own function.
+       (nnimap-request-rename-group): Unselect group before renaming.  This
+       had gotten lost somewhere.
+
 2010-11-20  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-gravatar.el (gnus-gravatar-transform-address): Decode name again.
index ed69c4c..0dd12af 100644 (file)
@@ -727,13 +727,17 @@ textual parts.")
 (deffoo nnimap-request-rename-group (group new-name &optional server)
   (when (nnimap-possibly-change-group nil server)
     (with-current-buffer (nnimap-buffer)
-      ;; Make sure we don't have this group open read/write by asking
-      ;; 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-unselect-group)
       (car (nnimap-command "RENAME %S %S"
                           (utf7-encode group t) (utf7-encode new-name t))))))
 
+(defun nnimap-unselect-group ()
+  ;; Make sure we don't have this group open read/write by asking
+  ;; 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"))
+
 (deffoo nnimap-request-expunge-group (group &optional server)
   (when (nnimap-possibly-change-group group server)
     (with-current-buffer (nnimap-buffer)