From: hmurata Date: Tue, 31 Aug 2004 14:01:25 +0000 (+0000) Subject: * elmo-multi.el (elmo-folder-count-flags): Changed return value X-Git-Tag: wl-2_11_31~28 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e46aa6dea08c2274db57bbb65d15bb5eca63a0bb;p=elisp%2Fwanderlust.git * elmo-multi.el (elmo-folder-count-flags): Changed return value (follow the API change). * elmo-filter.el (elmo-folder-count-flags): Ditto. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 903900a..872d571 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,10 @@ +2004-08-31 Hiroya Murata + + * elmo-multi.el (elmo-folder-count-flags): Changed return value + (follow the API change). + + * elmo-filter.el (elmo-folder-count-flags): Ditto. + 2004-08-31 Yuuichi Teranishi * modb-standard.el (modb-standard-digest-flags): Abolish. diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index 6ebcd1a..9a6c3ce 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -338,11 +338,7 @@ (elmo-folder-close-flag-table (elmo-filter-folder-target-internal folder))) (luna-define-method elmo-folder-count-flags ((folder elmo-filter-folder)) - (let* ((flag-count (elmo-filter-folder-flag-count folder)) - (new (or (cdr (assq 'new flag-count)) 0)) - (unread (or (cdr (assq 'unread flag-count)) 0)) - (answered(or (cdr (assq 'answered flag-count)) 0))) - (list new (- unread new) answered))) + (elmo-filter-folder-flag-count folder)) (luna-define-method elmo-folder-set-flag ((folder elmo-filter-folder) numbers diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index 5bca2c2..ac108fe 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -443,16 +443,13 @@ sum)) (luna-define-method elmo-folder-count-flags ((folder elmo-multi-folder)) - (let ((new 0) - (unreads 0) - (answered 0) - flags) + (let (flag-alist element) (dolist (child (elmo-multi-folder-children-internal folder)) - (setq flags (elmo-folder-count-flags child)) - (setq new (+ new (nth 0 flags))) - (setq unreads (+ unreads (nth 1 flags))) - (setq answered (+ answered (nth 2 flags)))) - (list new unreads answered))) + (dolist (pair (elmo-folder-count-flags child)) + (if (setq element (assq (car pair) flag-alist)) + (setcdr element (+ (cdr element) (cdr pair))) + (setq flag-alist (cons pair flag-alist))))) + flag-alist)) (require 'product) (product-provide (provide 'elmo-multi) (require 'elmo-version))