(gnus-group-delete-articles): Allow deleting only "old" articles.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Fri, 2 Aug 2013 12:51:25 +0000 (14:51 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Fri, 2 Aug 2013 12:51:25 +0000 (14:51 +0200)
lisp/ChangeLog
lisp/gnus-group.el

index e5f7d0f..670d84b 100644 (file)
@@ -1,5 +1,8 @@
 2013-08-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-group.el (gnus-group-delete-articles): Allow deleting only "old"
+       articles.
+
        * gnus-delay.el (gnus-delay-article): Run `message-send-hook' so that
        we can get spell-checking etc.
 
index 8050f5d..9533f58 100644 (file)
@@ -2796,14 +2796,21 @@ server."
        (lambda (group)
          (gnus-group-delete-group group nil t))))))
 
-(defun gnus-group-delete-articles (group)
-  "Delete all articles in the current group."
-  (interactive (list (gnus-group-group-name)))
+(defun gnus-group-delete-articles (group &optional oldp)
+  "Delete all articles in the current group.
+If OLDP (the prefix), only delete articles that are \"old\",
+according to the expiry settings.  Note that this will delete old
+not-expirable articles, too."
+  (interactive (list (gnus-group-group-name)
+                    current-prefix-arg))
   (let ((articles (gnus-uncompress-range (gnus-active group))))
     (when (gnus-yes-or-no-p
           (format "Do you really want to delete these %d articles forever? "
                   (length articles)))
-      (gnus-request-expire-articles articles group 'force))))
+      (gnus-request-expire-articles articles group
+                                   (if current-prefix-arg
+                                       nil
+                                     'force)))))
 
 (defun gnus-group-delete-group (group &optional force no-prompt)
   "Delete the current group.  Only meaningful with editable groups.