[gnus git] branch master updated: n0-17-156-g74e64f7 =1= 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 or killing a draft message.
Katsumi Yamaoka <[email protected]>
| Newsgroups | gmane.emacs.gnus.cvs |
|---|---|
| Message-ID | <[email protected]> |
via 74e64f736c6e1bde9360fbed2e0f5d6739820bec (commit)
from f6c6f122181a3b9ce91b27bc635532cc3902614a (commit)
- Log -----------------------------------------------------------------
commit 74e64f736c6e1bde9360fbed2e0f5d6739820bec
Author: Katsumi Yamaoka <[email protected]>
Date: Mon Jul 4 01:13:23 2011 +0000
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 or killing a draft message.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 05a9f12..0bd234e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-04 Katsumi Yamaoka <[email protected]>
+
+ * 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
+ or killing a draft message.
+
2011-07-03 Lars Magne Ingebrigtsen <[email protected]>
* gnus-group.el (gnus-read-ephemeral-bug-group): Bind the coding
diff --git a/lisp/nndraft.el b/lisp/nndraft.el
index 0063488..5275468 100644
--- a/lisp/nndraft.el
+++ b/lisp/nndraft.el
@@ -161,6 +161,16 @@ are generated if and only if they are also in `message-draft-headers'.")
(message-headers-to-generate
nndraft-required-headers message-draft-headers nil))))
+(defun nndraft-update-unread-articles ()
+ "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))))
+
(deffoo nndraft-request-associate-buffer (group)
"Associate the current buffer with some article in the draft group."
(nndraft-open-server "")
@@ -182,6 +192,10 @@ are generated if and only if they are also in `message-draft-headers'.")
'write-contents-hooks)))
(gnus-make-local-hook hook)
(add-hook hook 'nndraft-generate-headers nil t))
+ (gnus-make-local-hook 'after-save-hook)
+ (add-hook 'after-save-hook 'nndraft-update-unread-articles nil t)
+ (message-add-action '(nndraft-update-unread-articles)
+ 'exit 'postpone 'kill)
article))
(deffoo nndraft-request-group (group &optional server dont-check info)
-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.
Summary of changes:
lisp/ChangeLog | 7 +++++++
lisp/nndraft.el | 14 ++++++++++++++
2 files changed, 21 insertions(+), 0 deletions(-)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".
The branch, master has been updated
hooks/post-receive
--
Gnus Project