diff lisp/gnus/nnimap.el @ 66573:e65b759c6906

Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-630 Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 149-151) - Merge from emacs--cvs-trunk--0 - Update from CVS 2005-10-27 Reiner Steib <Reiner.Steib@gmx.de> * lisp/gnus/flow-fill.el (fill-flowed-encode-tests): Restore trailing whitespace removed in revision 7.8. Use concatenated string to protect trailing whitespace. 2005-10-27 Jouni K Seppanen <jks@iki.fi> (tiny change) * lisp/gnus/nnimap.el (nnimap-search-uids-not-since-is-evil): Add variable. (nnimap-request-expire-articles): Use it to avoid sending 'UID SEARCH UID ... NOT SINCE' queries, for inefficient servers like Courier IMAP ("some version from 2004"). Mostly based on similar code in the same function. 2005-10-26 Katsumi Yamaoka <yamaoka@jpl.org> * lisp/gnus/message.el (message-display-completion-list): New function. (message-expand-group): Use it; make sure the Completions buffer is modifiable.
author Miles Bader <miles@gnu.org>
date Mon, 31 Oct 2005 07:07:28 +0000
parents fafd692d1e40
children 1077b8039c32 7beb78bc1f8e
line wrap: on
line diff
--- a/lisp/gnus/nnimap.el	Mon Oct 31 01:59:51 2005 +0000
+++ b/lisp/gnus/nnimap.el	Mon Oct 31 07:07:28 2005 +0000
@@ -317,6 +317,11 @@
 Unlike other backends, you do not need to take special care if you
 flip this variable.")
 
+(defvoo nnimap-search-uids-not-since-is-evil nil
+  "If non-nil, avoid \"UID SEARCH UID ... NOT SINCE\" queries when expiring.
+Instead, use \"UID SEARCH SINCE\" to prune the list of expirable
+articles within Gnus.  This seems to be faster on Courier in some cases.")
+
 (defvoo nnimap-expunge-on-close 'always ; 'ask, 'never
   "Whether to expunge a group when it is closed.
 When a IMAP group with articles marked for deletion is closed, this
@@ -1438,6 +1443,21 @@
 			     (gnus-compress-sequence oldarts)) "\\Deleted")
 		       (setq articles (gnus-set-difference
 				       articles oldarts))))))
+		((and nnimap-search-uids-not-since-is-evil (numberp days))
+		 (let* ((all-new-articles
+			 (gnus-compress-sequence
+			  (imap-search (format "SINCE %s"
+					       (nnimap-date-days-ago days)))))
+			(oldartseq
+			 (gnus-range-difference artseq all-new-articles))
+			(oldarts (gnus-uncompress-range oldartseq)))
+		   (when oldarts
+		     (nnimap-expiry-target oldarts group server)
+		     (when (imap-message-flags-add
+			    (imap-range-to-message-set oldartseq)
+			    "\\Deleted")
+		       (setq articles (gnus-set-difference
+				       articles oldarts))))))
 		((numberp days)
 		 (let ((oldarts (imap-search
 				 (format nnimap-expunge-search-string