]> git.eshelyaron.com Git - emacs.git/commitdiff
nnir.el (nnir-request-expire-articles): New function.
authorAndrew Cohen <cohen@andy.bu.edu>
Wed, 8 Dec 2010 14:41:37 +0000 (14:41 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 8 Dec 2010 14:41:37 +0000 (14:41 +0000)
lisp/gnus/ChangeLog
lisp/gnus/nnir.el

index 25dd77cdf779e59b6b9afc0990ed060ccd72098d..9ce574f0cc93c12afed768c285e340ce58be687e 100644 (file)
@@ -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>
 
index 0a67f88f2386e4e25c28d81903f6cf09c26dfc31..726b01564e75070600505eb2334ca599a9add2b3 100644 (file)
@@ -687,6 +687,25 @@ Add an entry here when adding a new search engine.")
          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)