From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/46591 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: [PATCH] Re: nnimap: error/warning while trying to quit group Date: Tue, 17 Sep 2002 12:26:15 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1032289819 372 127.0.0.1 (17 Sep 2002 19:10:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 17 Sep 2002 19:10:19 +0000 (UTC) Return-path: Original-Received: from util2.math.uh.edu ([129.7.128.23]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17rNjj-00005i-00 for ; Tue, 17 Sep 2002 21:10:15 +0200 Original-Received: from karazm.math.uh.edu ([129.7.128.1]) by util2.math.uh.edu with esmtp (Exim 4.10) id 17rNXp-00010G-00; Tue, 17 Sep 2002 13:57:57 -0500 Original-Received: from sina.hpc.uh.edu (lists@sina.hpc.uh.edu [129.7.128.10]) by karazm.math.uh.edu (8.9.3/8.9.3) with ESMTP id FAA04521; Tue, 17 Sep 2002 05:26:35 -0500 (CDT) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 17 Sep 2002 05:27:15 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id FAA24858 for ; Tue, 17 Sep 2002 05:27:02 -0500 (CDT) Original-Received: (qmail 2793 invoked by alias); 17 Sep 2002 10:26:19 -0000 Original-Received: (qmail 2788 invoked from network); 17 Sep 2002 10:26:19 -0000 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net (HELO yxa.extundo.com) (217.13.230.178) by gnus.org with SMTP; 17 Sep 2002 10:26:19 -0000 Original-Received: from latte.josefsson.org (yxa.extundo.com [217.13.230.178]) by yxa.extundo.com (8.12.6/8.12.6) with ESMTP id g8HAQFn2014513 for ; Tue, 17 Sep 2002 12:26:15 +0200 Original-To: ding@gnus.org Mail-Copies-To: nobody X-Hashcash: 0:020917:ding@gnus.org:bf4d60ff4890eb13 In-Reply-To: (Nevin Kapur's message of "Mon, 16 Sep 2002 11:39:55 -0400") Original-Lines: 79 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-debian-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:46591 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:46591 Nevin Kapur writes: > The following patch fixes this for me. I'm not sure if this is the > "right" thing to do. Would someone review it and apply it if > appropriate? It looks fine, thanks. A code cleanup seems to be in order though, can you test this patch? (On some unimportant groups, preferably.) 2002-09-17 Simon Josefsson * nnimap.el (nnimap-expiry-target): Don't search for which articles exists here. (nnimap-request-expire-articles): Do it here instead. Only expire when articles are found. Suggested by Nevin Kapur . Index: nnimap.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnimap.el,v retrieving revision 6.39 diff -u -p -u -w -r6.39 nnimap.el --- nnimap.el 2002/09/11 08:13:03 6.39 +++ nnimap.el 2002/09/17 11:05:39 @@ -1298,10 +1298,7 @@ function is generally only called when G (defun nnimap-expiry-target (arts group server) (unless (eq nnmail-expiry-target 'delete) (with-temp-buffer - (dolist (art (imap-search (concat "UID " - (imap-range-to-message-set - (gnus-uncompress-sequence arts))) - nnimap-server-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) @@ -1320,16 +1317,16 @@ function is generally only called when G (let ((days (or (and nnmail-expiry-wait-function (funcall nnmail-expiry-wait-function group)) nnmail-expiry-wait))) - (cond (force - (nnimap-expiry-target artseq group server) - (when (imap-message-flags-add - (imap-range-to-message-set artseq) "\\Deleted") - (setq articles nil))) - ((eq days 'immediate) - (nnimap-expiry-target artseq group server) + (cond ((or force (eq days 'immediate)) + (let ((oldarts (imap-search + (concat "UID " + (imap-range-to-message-set artseq))))) + (when oldarts + (nnimap-expiry-target oldarts group server)) (when (imap-message-flags-add - (imap-range-to-message-set artseq) "\\Deleted") - (setq articles nil))) + (imap-range-to-message-set oldarts) "\\Deleted") + (setq articles (gnus-set-difference + articles oldarts))))) ((numberp days) (let ((oldarts (imap-search (format nnimap-expunge-search-string @@ -1337,12 +1334,10 @@ function is generally only called when G (nnimap-date-days-ago days)))) (imap-fetch-data-hook '(nnimap-request-expire-articles-progress))) - (nnimap-expiry-target oldarts group server) - (and oldarts - (imap-message-flags-add - (imap-range-to-message-set - (gnus-compress-sequence oldarts)) - "\\Deleted") + (when oldarts + (nnimap-expiry-target oldarts group server)) + (when (imap-message-flags-add + (imap-range-to-message-set oldarts) "\\Deleted") (setq articles (gnus-set-difference articles oldarts)))))))))) ;; return articles not deleted