From: yamaoka Date: Thu, 27 Oct 2005 09:03:10 +0000 (+0000) Subject: Synch to No Gnus 200510270858. X-Git-Tag: t-gnus-6_17_4-quimby-~275 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=89060814251792c0f2a919e74543b27b3430ebad;p=elisp%2Fgnus.git- Synch to No Gnus 200510270858. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0ca767f..56d36c1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2005-10-27 Jouni K Seppanen (tiny change) + + * 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 Didier Verna * gnus-group.el (gnus-group-compact-group): invalidate original diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 77f0c00..1da27f1 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -318,6 +318,11 @@ every message in the group, thus making it quite slow. 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 @@ -1494,6 +1499,21 @@ function is generally only called when Gnus is shutting down." (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