nndraft.el (nndraft-update-unread-articles): Don't show group having no unread articl...
authorKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 4 Jul 2011 02:16:17 +0000 (02:16 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 4 Jul 2011 02:16:17 +0000 (02:16 +0000)
lisp/ChangeLog
lisp/nndraft.el

index 0bd234e..bd702de 100644 (file)
@@ -1,5 +1,8 @@
 2011-07-04  Katsumi Yamaoka  <yamaoka@jpl.org>
 
+       * nndraft.el (nndraft-update-unread-articles): Don't show group having
+       no unread article unless it matches gnus-permanently-visible-groups.
+
        * nndraft.el (nndraft-update-unread-articles): New function.
        (nndraft-request-associate-buffer): Use it to update the number of
        unread articles for the nndraft groups in the group buffer when saving
index 5275468..459778b 100644 (file)
@@ -165,11 +165,20 @@ are generated if and only if they are also in `message-draft-headers'.")
   "Update groups' unread articles in the group buffer."
   (nndraft-request-list)
   (with-current-buffer gnus-group-buffer
-    (let ((gnus-group-marked
-          (mapcar (lambda (elem)
-                    (gnus-group-prefixed-name (car elem) (list 'nndraft "")))
-                  (nnmail-get-active))))
-      (gnus-group-get-new-news-this-group nil t))))
+    (let* ((groups (mapcar (lambda (elem)
+                            (gnus-group-prefixed-name (car elem)
+                                                      (list 'nndraft "")))
+                          (nnmail-get-active)))
+          (gnus-group-marked (copy-sequence groups))
+          (inhibit-read-only t))
+      (gnus-group-get-new-news-this-group nil t)
+      (dolist (group groups)
+       (unless (and gnus-permanently-visible-groups
+                    (string-match gnus-permanently-visible-groups
+                                  group))
+         (gnus-group-goto-group group)
+         (when (zerop (gnus-group-group-unread))
+           (gnus-delete-line)))))))
 
 (deffoo nndraft-request-associate-buffer (group)
   "Associate the current buffer with some article in the draft group."