(gnus-summary-kill-thread): Allow universal prefix zero
authorTeodor Zlatanov <tzz@lifelogs.com>
Thu, 27 Sep 2007 10:40:02 +0000 (10:40 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Thu, 27 Sep 2007 10:40:02 +0000 (10:40 +0000)
to mark a thread as expirable.  Add variable `hide' to handle hiding of
thread for both the null and zero (kill/expire thread) universal prefix
cases.

lisp/ChangeLog
lisp/gnus-sum.el

index 1fd71a9..86bbfa1 100644 (file)
@@ -1,3 +1,10 @@
+2007-09-27  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * gnus-sum.el (gnus-summary-kill-thread): Allow universal prefix zero
+       to mark a thread as expirable.  Add variable `hide' to handle hiding of
+       thread for both the null and zero (kill/expire thread) universal prefix
+       cases.
+
 2007-09-25  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * gnus-registry.el (gnus-registry-store-extra-entry): Allow for nil
index db3932b..6b74845 100644 (file)
@@ -11397,11 +11397,13 @@ taken."
 (defun gnus-summary-kill-thread (&optional unmark)
   "Mark articles under current thread as read.
 If the prefix argument is positive, remove any kinds of marks.
+If the prefix argument is zero, mark thread as expired.
 If the prefix argument is negative, tick articles instead."
   (interactive "P")
   (when unmark
     (setq unmark (prefix-numeric-value unmark)))
-  (let ((articles (gnus-summary-articles-in-thread)))
+  (let ((articles (gnus-summary-articles-in-thread))
+       (hide (or (null unmark) (= unmark 0))))
     (save-excursion
       ;; Expand the thread.
       (gnus-summary-show-thread)
@@ -11412,15 +11414,17 @@ If the prefix argument is negative, tick articles instead."
               (gnus-summary-mark-article-as-read gnus-killed-mark))
              ((> unmark 0)
               (gnus-summary-mark-article-as-unread gnus-unread-mark))
+             ((= unmark 0)
+              (gnus-summary-mark-article-as-unread gnus-expirable-mark))
              (t
               (gnus-summary-mark-article-as-unread gnus-ticked-mark)))
        (setq articles (cdr articles))))
-    ;; Hide killed subtrees.
-    (and (null unmark)
+    ;; Hide killed subtrees when hide is true.
+    (and hide
         gnus-thread-hide-killed
         (gnus-summary-hide-thread))
-    ;; If marked as read, go to next unread subject.
-    (when (null unmark)
+    ;; If hide is t, go to next unread subject.
+    (when hide
       ;; Go to next unread subject.
       (gnus-summary-next-subject 1 t)))
   (gnus-set-mode-line 'summary))