Don't expire unexisting (nnimap) articles
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 10 Mar 2012 00:51:00 +0000 (01:51 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 10 Mar 2012 00:51:00 +0000 (01:51 +0100)
* gnus-sum.el (gnus-summary-expire-articles): Ditto.

* gnus-group.el (gnus-group-expire-articles-1): Don't try to expire
messages that don't exist.

lisp/ChangeLog
lisp/gnus-group.el
lisp/gnus-sum.el

index bb8e2ea..4e591fe 100644 (file)
@@ -1,3 +1,10 @@
+2012-03-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-group.el (gnus-group-expire-articles-1): Don't try to expire
+       messages that don't exist.
+
+       * gnus-sum.el (gnus-summary-expire-articles): Ditto.
+
 2012-03-04  Thierry Volpiatto  <thierry.volpiatto@gmail.com>
 
        * gnus-msg.el (gnus-msg-mail): Call `message-mail' correctly when Gnus
index f75ef37..0c3346a 100644 (file)
@@ -3643,6 +3643,10 @@ Uses the process/prefix convention."
           (expirable (if (gnus-group-total-expirable-p group)
                          (cons nil (gnus-list-of-read-articles group))
                        (assq 'expire (gnus-info-marks info))))
+          (articles-to-expire
+           (gnus-list-range-difference
+            (gnus-uncompress-sequence (cdr expirable))
+            (cdr (assq 'unexist (gnus-info-marks info)))))
           (expiry-wait (gnus-group-find-parameter group 'expiry-wait))
           (nnmail-expiry-target
            (or (gnus-group-find-parameter group 'expiry-target)
@@ -3657,11 +3661,9 @@ Uses the process/prefix convention."
              ;; parameter.
              (let ((nnmail-expiry-wait-function nil)
                    (nnmail-expiry-wait expiry-wait))
-               (gnus-request-expire-articles
-                (gnus-uncompress-sequence (cdr expirable)) group))
+               (gnus-request-expire-articles articles-to-expire group))
            ;; Just expire using the normal expiry values.
-           (gnus-request-expire-articles
-            (gnus-uncompress-sequence (cdr expirable)) group))))
+           (gnus-request-expire-articles articles-to-expire group))))
        (gnus-close-group group))
       (gnus-message 6 "Expiring articles in %s...done"
                    (gnus-group-decoded-name group))
index 77bbe38..46e246f 100644 (file)
@@ -10304,16 +10304,19 @@ This will be the case if the article has both been mailed and posted."
              'request-expire-articles gnus-newsgroup-name))
     ;; This backend supports expiry.
     (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name))
-          (expirable (if total
-                         (progn
-                           ;; We need to update the info for
-                           ;; this group for `gnus-list-of-read-articles'
-                           ;; to give us the right answer.
-                           (gnus-run-hooks 'gnus-exit-group-hook)
-                           (gnus-summary-update-info)
-                           (gnus-list-of-read-articles gnus-newsgroup-name))
-                       (setq gnus-newsgroup-expirable
-                             (sort gnus-newsgroup-expirable '<))))
+          (expirable
+           (gnus-list-range-difference
+            (if total
+                (progn
+                  ;; We need to update the info for
+                  ;; this group for `gnus-list-of-read-articles'
+                  ;; to give us the right answer.
+                  (gnus-run-hooks 'gnus-exit-group-hook)
+                  (gnus-summary-update-info)
+                  (gnus-list-of-read-articles gnus-newsgroup-name))
+              (setq gnus-newsgroup-expirable
+                    (sort gnus-newsgroup-expirable '<)))
+            gnus-newsgroup-unexist))
           (expiry-wait (if now 'immediate
                          (gnus-group-find-parameter
                           gnus-newsgroup-name 'expiry-wait)))