From: Katsumi Yamaoka Date: Mon, 4 Jul 2011 02:19:08 +0000 (+0000) Subject: nndraft.el (nndraft-update-unread-articles): Don't show group having no unread articl... X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~206^2~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bb9e218d460321560ef2841085bf88349f58009c;p=emacs.git nndraft.el (nndraft-update-unread-articles): Don't show group having no unread article unless it matches gnus-permanently-visible-groups. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 45c051c6913..d621333f287 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,8 @@ 2011-07-04 Katsumi Yamaoka + * 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 diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el index 5275468bb6f..459778bf4b3 100644 --- a/lisp/gnus/nndraft.el +++ b/lisp/gnus/nndraft.el @@ -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."