* texi/gnus-ja.texi (Article Date): Update Japanese translation.
[elisp/gnus.git-] / lisp / nnimap.el
index c88021c..6740e65 100644 (file)
@@ -60,7 +60,7 @@
 
 (eval-when-compile (require 'cl))
 (eval-when-compile (require 'gnus-clfns))
-(eval-and-compile (require 'imap))
+(require 'imap)
 
 (require 'nnoo)
 (require 'nnmail)
@@ -174,7 +174,7 @@ group/function elements."
                         (nnimap-strict-function :tag "User-defined function"))
                 (repeat :menu-tag "Multi-server (extended)"
                         :tag "Multi-server list"
-                        (list (regexp :tag "Server regexp") 
+                        (list (regexp :tag "Server regexp")
                               (list (regexp :tag "Incoming Mailbox regexp")
                                     (repeat :tag "Rules for matching server(s) and mailbox(es)"
                                             (list (string :tag "Destination mailbox")
@@ -196,6 +196,14 @@ RFC2060 section 6.4.4."
   :group 'nnimap
   :type 'sexp)
 
+(defcustom nnimap-close-asynchronous nil
+  "Close mailboxes asynchronously in `nnimap-close-group'.
+This means that errors cought by nnimap when closing the mailbox will
+not prevent Gnus from updating the group status, which may be harmful.
+However, it increases speed."
+  :type 'boolean
+  :group 'nnimap)
+
 ;; Authorization / Privacy variables
 
 (defvoo nnimap-auth-method nil
@@ -838,14 +846,14 @@ function is generally only called when Gnus is shutting down."
     (when (and (imap-opened)
               (nnimap-possibly-change-group group server))
       (case nnimap-expunge-on-close
-       ('always (imap-mailbox-expunge)
-                (imap-mailbox-close))
-       ('ask (if (and (imap-search "DELETED")
+       (always (imap-mailbox-expunge nnimap-close-asynchronous)
+                (imap-mailbox-close nnimap-close-asynchronous))
+       (ask (if (and (imap-search "DELETED")
                       (gnus-y-or-n-p (format
                                       "Expunge articles in group `%s'? "
                                       imap-current-mailbox)))
-                 (progn (imap-mailbox-expunge)
-                        (imap-mailbox-close))
+                 (progn (imap-mailbox-expunge nnimap-close-asynchronous)
+                        (imap-mailbox-close nnimap-close-asynchronous))
                (imap-mailbox-unselect)))
        (t (imap-mailbox-unselect)))
       (not imap-current-mailbox))))
@@ -1308,7 +1316,7 @@ function is generally only called when Gnus is shutting down."
 
 (defun nnimap-expunge (mailbox server)
   (when (nnimap-possibly-change-group mailbox server)
-    (imap-mailbox-expunge nnimap-server-buffer)))
+    (imap-mailbox-expunge nil nnimap-server-buffer)))
 
 (defun nnimap-acl-get (mailbox server)
   (when (nnimap-possibly-change-server server)