Unselect by selecting a mailbox that doesn't exist.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Tue, 12 Oct 2010 21:23:41 +0000 (23:23 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Tue, 12 Oct 2010 21:23:41 +0000 (23:23 +0200)
lisp/ChangeLog
lisp/nnimap.el

index ebb4fd5..0eba77e 100644 (file)
@@ -1,3 +1,8 @@
+2010-10-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * nnimap.el (nnimap-request-rename-group): Unselect by selecting a
+       mailbox that doesn't exist.
+
 2010-10-12  Julien Danjou  <julien@danjou.info>
 
        * shr.el (shr-tag-img): Encode URL properly when retrieving.
index b58c747..c6c8787 100644 (file)
@@ -673,8 +673,11 @@ 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.
-      (nnimap-command "EXAMINE %S" (utf7-encode group 7))
+      ;; 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")
       (setf (nnimap-group nnimap-object) nil)
       (car (nnimap-command "RENAME %S %S"
                           (utf7-encode group t) (utf7-encode new-name t))))))