From 64bb785d8c1a828930d5d0259e9c61a24f9b3875 Mon Sep 17 00:00:00 2001 From: hmurata Date: Fri, 11 Feb 2005 16:59:20 +0000 Subject: [PATCH] (elmo-multi-folder-diff): Fixed problem when the element of the difference is nil. --- elmo/ChangeLog | 5 +++++ elmo/elmo-multi.el | 34 ++++++++++++++++------------------ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 0ea3002..396bc35 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,8 @@ +2005-02-11 Hiroya Murata + + * elmo-multi.el (elmo-multi-folder-diff): Fixed problem when the + element of the difference is nil. + 2005-02-11 Yuuichi Teranishi * elmo-maildir.el (elmo-maildir-separator): Added some OS types diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index ccc899c..b4700b3 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -270,26 +270,24 @@ (elmo-multi-folder-diff folder)) (defun elmo-multi-folder-diff (folder) - (let ((flds (elmo-multi-folder-children-internal folder)) - (news 0) + (let ((news 0) (unreads 0) (alls 0) - no-unreads diff) - (while flds - (setq diff (elmo-folder-diff (car flds))) - (cond - ((consp (cdr diff)) ; (new unread all) - (setq news (+ news (nth 0 diff)) - unreads (+ unreads (nth 1 diff)) - alls (+ alls (nth 2 diff)))) - (t - (setq no-unreads t) - (setq news (+ news (car diff)) - alls (+ alls (cdr diff))))) - (setq flds (cdr flds))) - (if no-unreads - (cons news alls) - (list news unreads alls)))) + diff value) + (dolist (child (elmo-multi-folder-children-internal folder)) + (setq diff (elmo-folder-diff child)) + (setq news (and news + (setq value (elmo-diff-new diff)) + (+ news value)) + unreads (and unreads + (setq value (elmo-diff-unread diff)) + (+ unreads value)) + alls (and alls + (setq value (elmo-diff-all diff)) + (+ alls value)))) + (if unreads + (list news unreads alls) + (cons news alls)))) (luna-define-method elmo-folder-list-messages ((folder elmo-multi-folder) &optional visible-only in-msgdb) -- 1.7.10.4