changeset 111853:f7152aa1cc94

nnir.el (nnir-request-expire-articles): New function.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Wed, 08 Dec 2010 14:41:37 +0000
parents 7b4048d45603
children 1d5b34014445
files lisp/gnus/ChangeLog lisp/gnus/nnir.el
diffstat 2 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Wed Dec 08 13:49:49 2010 +0000
+++ b/lisp/gnus/ChangeLog	Wed Dec 08 14:41:37 2010 +0000
@@ -3,6 +3,7 @@
 	* nnir.el (nnir-retrieve-headers): Use rassq when comparing article
 	ids.
 	(nnir-run-gmane): Simplify groupspec formatting.
+	(nnir-request-expire-articles): New function.
 
 2010-12-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
--- a/lisp/gnus/nnir.el	Wed Dec 08 13:49:49 2010 +0000
+++ b/lisp/gnus/nnir.el	Wed Dec 08 14:41:37 2010 +0000
@@ -687,6 +687,25 @@
 	  to-newsgroup		; Not respooling
 	  (gnus-group-real-name to-newsgroup)))))
 
+(deffoo nnir-request-expire-articles (articles group &optional server force)
+  (let ((articles-by-group (nnir-categorize
+			    articles nnir-article-group nnir-article-ids))
+	not-deleted)
+    (while (not (null articles-by-group))
+      (let* ((group-articles (pop articles-by-group))
+	     (artgroup (car group-articles))
+	     (articleids (cadr group-articles))
+	     (artlist (sort (mapcar 'cdr articleids) '<)))
+	(unless (gnus-check-backend-function 'request-expire-articles
+					     artgroup)
+	  (error "The group %s does not support article deletion" artgroup))
+	(unless (gnus-check-server (gnus-find-method-for-group artgroup))
+	  (error "Couldn't open server for group %s" artgroup))
+	(push (gnus-request-expire-articles
+	       artlist artgroup force)
+	      not-deleted)))
+    (sort (delq nil not-deleted) '<)))
+
 (deffoo nnir-warp-to-article ()
   (let* ((cur (if (> (gnus-summary-article-number) 0)
 		  (gnus-summary-article-number)