X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fnnimap.el;h=1da27f11047c8664d8faf2206781f6198a42e5a7;hb=779dd81d09cb6fa76e6a0fd64147099b7cf0119d;hp=53e9876b6a69183f97414e8a795871a9a64d09cc;hpb=8c2a5a5cf5226f37cbe192d6aee9df67d8ec93c9;p=elisp%2Fgnus.git- diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 53e9876..1da27f1 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -1,6 +1,7 @@ ;;; nnimap.el --- imap backend for Gnus -;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -;; Free Software Foundation, Inc. + +;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, +;; 2005 Free Software Foundation, Inc. ;; Author: Simon Josefsson ;; Jim Radford @@ -317,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 @@ -1493,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