Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <jas@extundo.com>
Subject: Re: [PATCH] Re: nnimap: error/warning while trying to quit group
Date: Tue, 17 Sep 2002 12:26:15 +0200	[thread overview]
Message-ID: <iluelbsdi9k.fsf@latte.josefsson.org> (raw)
In-Reply-To: <m3ptve9c50.fsf@fermat.mts.jhu.edu> (Nevin Kapur's message of "Mon, 16 Sep 2002 11:39:55 -0400")

Nevin Kapur <nevin@jhu.edu> 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  <jas@extundo.com>

	* 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
	<nevin@jhu.edu>.

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




  reply	other threads:[~2002-09-17 10:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-16 13:54 Nevin Kapur
2002-09-16 15:39 ` [PATCH] " Nevin Kapur
2002-09-17 10:26   ` Simon Josefsson [this message]
2002-09-17 20:31     ` Nevin Kapur
2002-09-18  9:53       ` Simon Josefsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=iluelbsdi9k.fsf@latte.josefsson.org \
    --to=jas@extundo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).