From b957eaf442b63ea24eb3bee0159bf14b0f3f73d8 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Bj=C3=B8rn=20Mork?= Date: Tue, 20 Apr 2010 17:37:23 +0200 Subject: [PATCH] nnimap.el: - accelerate the common server-internal expiry-target case MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bjørn Mork --- lisp/nnimap.el | 25 +++++++++++++++++-------- 1 files changed, 17 insertions(+), 8 deletions(-) diff --git a/lisp/nnimap.el b/lisp/nnimap.el index c76169c..3a06adb 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -1553,14 +1553,23 @@ function is generally only called when Gnus is shutting down." (defun nnimap-expiry-target (arts group server) (unless (eq nnmail-expiry-target 'delete) - (with-temp-buffer - (dolist (art arts) - (nnimap-request-article art group server (current-buffer)) - ;; hints for optimization in `nnimap-request-accept-article' - (let ((nnimap-current-move-article art) - (nnimap-current-move-group group) - (nnimap-current-move-server server)) - (nnmail-expiry-target-group nnmail-expiry-target group)))) + (if (and (not (functionp nnmail-expiry-target)) + (gnus-server-equal (gnus-group-method nnmail-expiry-target) + (gnus-server-to-method + (format "nnimap:%s" server)))) + ;; moving article within same server, speed it up... + (and (nnimap-possibly-change-group group) + (imap-message-copy (imap-range-to-message-set arts) + (gnus-group-short-name nnmail-expiry-target) + 'dontcreate nil nnimap-server-buffer)) + (with-temp-buffer + (dolist (art arts) + (nnimap-request-article art group server (current-buffer)) + ;; hints for optimization in `nnimap-request-accept-article' + (let ((nnimap-current-move-article art) + (nnimap-current-move-group group) + (nnimap-current-move-server server)) + (nnmail-expiry-target-group nnmail-expiry-target group))))) ;; It is not clear if `nnmail-expiry-target' somehow cause the ;; current group to be changed or not, so we make sure here. (nnimap-possibly-change-group group server))) -- 1.5.6.5