From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/45873 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: nnimap-request-expire-articles bug? (Was Re: nnimap, expiry-target, nnmail-fancy-expiry-targets) Date: Mon, 29 Jul 2002 13:47:59 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: <87sn2fiznh.fsf@hal.Olympus.INVALID> <87eldyajuu.fsf@hal.Olympus.INVALID> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1027943300 28991 127.0.0.1 (29 Jul 2002 11:48:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 29 Jul 2002 11:48:20 +0000 (UTC) Cc: ding@gnus.org Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17Z90d-0007XU-00 for ; Mon, 29 Jul 2002 13:48:19 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 17Z90e-0005R6-00; Mon, 29 Jul 2002 06:48:20 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 29 Jul 2002 06:48:47 -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 GAA03705 for ; Mon, 29 Jul 2002 06:48:34 -0500 (CDT) Original-Received: (qmail 9589 invoked by alias); 29 Jul 2002 11:48:03 -0000 Original-Received: (qmail 9584 invoked from network); 29 Jul 2002 11:48:02 -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; 29 Jul 2002 11:48:02 -0000 Original-Received: from latte.josefsson.org (yxa.extundo.com [217.13.230.178]) (authenticated bits=0) by yxa.extundo.com (8.12.5/8.12.5) with ESMTP id g6TBlxkd012064; Mon, 29 Jul 2002 13:48:00 +0200 Original-To: "Davide G. M. Salvetti" Mail-Copies-To: nobody X-Hashcash: 020729:salve@icube.it:f0ee5a470856c08f X-Hashcash: 020729:ding@gnus.org:19ebb2c6ce5c91d3 In-Reply-To: <87eldyajuu.fsf@hal.Olympus.INVALID> ("Davide G. M. Salvetti"'s message of "Sat, 20 Jul 2002 10:23:21 +0200") Original-Lines: 73 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.3.50 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:45873 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:45873 "Davide G. M. Salvetti" writes: > So I found that gnus-request-expire-articles is passed a list of > expirable articles which possibly contains no longer existent articles: > since this is a totally-expirable group, it is passed > (gnus-list-of-read-articles group), by gnus-group-expire-articles-1: > according to the source this means active articles minus unread articles > minus dormant articles minus tick marked; the thesis follow since active > articles include deleted articles in between. > > When nnimap-request-expire-articles receives this list, it doesn't > subtract non existing articles (contrary to what, say, > nnml-request-expire-articles do), and does the whole list. > > Since we have an expiry-target in this group, nnmail-expiry-target-group > gets called in the (possibly empty because no such article exists) > buffer which results from nnimap-request-article, for each (possibly non > existent) article in the list. > > In our situation nnmail-expiry-target-group calls > nnmail-fancy-expiry-target, which barfs because it can't find any > "From", "To", "Date", ... in the sadly empty buffer which resulted from > the non existent article request. > > I think that nnimap-request-expire-articles should be fixed to subtract > non existing articles before doing the list. I'd fix it, but at this > moment I don't know how to open the right holes (corresponding to > deleted articles) in the list. Yup. Does this work? Index: nnimap.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnimap.el,v retrieving revision 6.37 diff -u -p -u -w -r6.37 nnimap.el --- nnimap.el 2002/07/10 16:28:39 6.37 +++ nnimap.el 2002/07/29 12:04:54 @@ -1296,7 +1296,10 @@ 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 (gnus-uncompress-sequence arts)) + (dolist (art (imap-search (concat "UID " + (imap-range-to-message-set + (gnus-uncompress-sequence arts))) + nnimap-server-buffer)) (nnimap-request-article art group server (current-buffer)) ;; hints for optimization in `nnimap-request-accept-article' (let ((nnimap-current-move-article art) @@ -1312,16 +1315,15 @@ function is generally only called when G (let ((artseq (gnus-compress-sequence articles))) (when (and artseq (nnimap-possibly-change-group group server)) (with-current-buffer nnimap-server-buffer - (if force - (progn - (nnimap-expiry-target artseq group server) - (when (imap-message-flags-add (imap-range-to-message-set artseq) - "\\Deleted") - (setq articles nil))) (let ((days (or (and nnmail-expiry-wait-function (funcall nnmail-expiry-wait-function group)) nnmail-expiry-wait))) - (cond ((eq days 'immediate) + (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) (when (imap-message-flags-add (imap-range-to-message-set artseq) "\\Deleted")