From 46cad0ee179c3281f8b48f1773d7ed4cc2ada354 Mon Sep 17 00:00:00 2001 From: teranisi Date: Tue, 31 Aug 2004 09:04:57 +0000 Subject: [PATCH] * elmo.el (elmo-folder-count-flags): Changed return value. * elmo-flag.el (elmo-preserved-flags): New variable. (elmo-get-global-flags): Use it. --- elmo/ChangeLog | 5 +++++ elmo/elmo-flag.el | 6 +++++- elmo/elmo.el | 12 ++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 8ae0e56..f755d10 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,5 +1,10 @@ 2004-08-31 Yuuichi Teranishi + * elmo.el (elmo-folder-count-flags): Changed return value. + + * elmo-flag.el (elmo-preserved-flags): New variable. + (elmo-get-global-flags): Use it. + * modb-standard.el (modb-standard-digest-flags): New variable. (elmo-msgdb-list-flagged): Use it for `digest'; Add `uncached'; Changed behavior of `any'. diff --git a/elmo/elmo-flag.el b/elmo/elmo-flag.el index dfb0466..781b31b 100644 --- a/elmo/elmo-flag.el +++ b/elmo/elmo-flag.el @@ -30,6 +30,10 @@ (eval-when-compile (require 'cl)) ;;; Code: +(defcustom elmo-preserved-flags '(answered cached new unread) + "Reserved flags which are not treated as global." + :type '(repeat (symbol :tag "flag"))) + (defcustom elmo-global-flag-list '(important) "A list of flag symbol which is managed globally by the flag folder." :type '(repeat symbol) @@ -391,7 +395,7 @@ If optional IGNORE-PRESERVED is non-nil, preserved flags (setq result (delq (car flags) result))) (setq flags (cdr flags))) (when ignore-preserved - (dolist (flag '(answered cached new unread)) + (dolist (flag elmo-preserved-flags) (setq result (delq flag result)))) result)) diff --git a/elmo/elmo.el b/elmo/elmo.el index 4eda3f6..87b0b4c 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1186,14 +1186,14 @@ ENTITY is the message-entity to get the parent.") (luna-define-generic elmo-folder-count-flags (folder) "Count flagged message number in the msgdb of the FOLDER. -Return a list of numbers (`new' `unread' `answered')") +Return alist of flag and numbers. +Example: +\(\(new . 10\) + \(unread . 20\) + \(answered . 3\)\)") (luna-define-method elmo-folder-count-flags ((folder elmo-folder)) - (let* ((flag-count (elmo-msgdb-flag-count (elmo-folder-msgdb 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-msgdb-flag-count (elmo-folder-msgdb folder))) (defun elmo-message-set-flag (folder number flag &optional is-local) "Set message flag. -- 1.7.10.4