* elmo-flag.el (elmo-preserved-flags): New variable.
(elmo-get-global-flags): Use it.
2004-08-31 Yuuichi Teranishi <teranisi@gohome.org>
+ * 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'.
(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)
(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))
(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.