aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKatsumi Yamaoka2011-07-04 01:14:10 +0000
committerKatsumi Yamaoka2011-07-04 01:14:10 +0000
commit30b0f2501c5d2ed922a9935cdc239eab1f657ba7 (patch)
tree10938acf0c63ff4c9ce95feebc75840964b26382
parent3abb79e569258dd1e29e9549718f7e4701c61566 (diff)
downloademacs-30b0f2501c5d2ed922a9935cdc239eab1f657ba7.tar.gz
emacs-30b0f2501c5d2ed922a9935cdc239eab1f657ba7.zip
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.
-rw-r--r--lisp/gnus/ChangeLog7
-rw-r--r--lisp/gnus/nndraft.el14
2 files changed, 21 insertions, 0 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 47b41ffb98b..45c051c6913 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,10 @@
12011-07-04 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * nndraft.el (nndraft-update-unread-articles): New function.
4 (nndraft-request-associate-buffer): Use it to update the number of
5 unread articles for the nndraft groups in the group buffer when saving
6 or killing a draft message.
7
12011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org> 82011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 9
3 * gnus-group.el (gnus-read-ephemeral-bug-group): Bind the coding 10 * gnus-group.el (gnus-read-ephemeral-bug-group): Bind the coding
diff --git a/lisp/gnus/nndraft.el b/lisp/gnus/nndraft.el
index 006348869ef..5275468bb6f 100644
--- a/lisp/gnus/nndraft.el
+++ b/lisp/gnus/nndraft.el
@@ -161,6 +161,16 @@ are generated if and only if they are also in `message-draft-headers'.")
161 (message-headers-to-generate 161 (message-headers-to-generate
162 nndraft-required-headers message-draft-headers nil)))) 162 nndraft-required-headers message-draft-headers nil))))
163 163
164(defun nndraft-update-unread-articles ()
165 "Update groups' unread articles in the group buffer."
166 (nndraft-request-list)
167 (with-current-buffer gnus-group-buffer
168 (let ((gnus-group-marked
169 (mapcar (lambda (elem)
170 (gnus-group-prefixed-name (car elem) (list 'nndraft "")))
171 (nnmail-get-active))))
172 (gnus-group-get-new-news-this-group nil t))))
173
164(deffoo nndraft-request-associate-buffer (group) 174(deffoo nndraft-request-associate-buffer (group)
165 "Associate the current buffer with some article in the draft group." 175 "Associate the current buffer with some article in the draft group."
166 (nndraft-open-server "") 176 (nndraft-open-server "")
@@ -182,6 +192,10 @@ are generated if and only if they are also in `message-draft-headers'.")
182 'write-contents-hooks))) 192 'write-contents-hooks)))
183 (gnus-make-local-hook hook) 193 (gnus-make-local-hook hook)
184 (add-hook hook 'nndraft-generate-headers nil t)) 194 (add-hook hook 'nndraft-generate-headers nil t))
195 (gnus-make-local-hook 'after-save-hook)
196 (add-hook 'after-save-hook 'nndraft-update-unread-articles nil t)
197 (message-add-action '(nndraft-update-unread-articles)
198 'exit 'postpone 'kill)
185 article)) 199 article))
186 200
187(deffoo nndraft-request-group (group &optional server dont-check info) 201(deffoo nndraft-request-group (group &optional server dont-check info)