+(defun nndraft-generate-headers ()
+ (save-excursion
+ (message-generate-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* ((groups (mapcar (lambda (elem)
+ (gnus-group-prefixed-name (car elem)
+ (list 'nndraft "")))
+ (nnmail-get-active)))
+ (gnus-group-marked (copy-sequence groups))
+ ;; Don't send delayed articles.
+ (gnus-get-new-news-hook nil)
+ (inhibit-read-only t))
+ (gnus-group-get-new-news-this-group nil t)
+ (save-excursion
+ (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))))))))
+