X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=elmo%2Felmo-msgdb.el;h=bbe7d439ad8a7ac38458240be25b564f0b5a4c44;hb=107c307c8be7235fd1d35a22107c4df7acd736fe;hp=74241865aae3e5ee745dea41c8fa01dc12d1b806;hpb=68390611bb737631a88b3c622684060c89a3d0c9;p=elisp%2Fwanderlust.git diff --git a/elmo/elmo-msgdb.el b/elmo/elmo-msgdb.el index 7424186..bbe7d43 100644 --- a/elmo/elmo-msgdb.el +++ b/elmo/elmo-msgdb.el @@ -120,6 +120,11 @@ if MARK is nil, mark is removed." ;; return value. t)) +(defun elmo-msgdb-get-cached (msgdb number) + "Return non-nil if message is cached." + (not (member (elmo-msgdb-get-mark msgdb number) + (elmo-msgdb-uncached-marks)))) + (defun elmo-msgdb-set-cached (msgdb number cached use-cache) "Set message cache status. If mark is changed, return non-nil." @@ -637,12 +642,17 @@ header separator." entity) numbers))) (string-to-int (elmo-filter-value condition))))) - ((string= key "mark") + ((string= key "flag") (setq result (cond ((string= (elmo-filter-value condition) "any") (not (or (null mark) (string= mark elmo-msgdb-read-uncached-mark)))) + ((string= (elmo-filter-value condition) "digest") + (not (or (null mark) + (string= mark elmo-msgdb-read-uncached-mark) + (string= mark elmo-msgdb-answered-cached-mark) + (string= mark elmo-msgdb-answered-uncached-mark)))) ;; (member mark (append (elmo-msgdb-answered-marks) ;; (list elmo-msgdb-important-mark) ;; (elmo-msgdb-unread-marks)))) @@ -1171,6 +1181,41 @@ Return the updated INDEX." elmo-msgdb-location-filename dir) alist)) +(defun elmo-msgdb-list-flagged (msgdb flag) + (let ((case-fold-search nil) + mark-regexp matched) + (case flag + (new + (setq mark-regexp (regexp-quote elmo-msgdb-new-mark))) + (unread + (setq mark-regexp (elmo-regexp-opt (elmo-msgdb-unread-marks)))) + (answered + (setq mark-regexp (elmo-regexp-opt (elmo-msgdb-unread-marks)))) + (important + (setq mark-regexp (regexp-quote elmo-msgdb-important-mark))) + (read + (setq mark-regexp (elmo-regexp-opt (elmo-msgdb-unread-marks)))) + (digest + (setq mark-regexp (elmo-regexp-opt + (append (elmo-msgdb-unread-marks) + (list elmo-msgdb-important-mark))))) + (any + (setq mark-regexp (elmo-regexp-opt + (append + (elmo-msgdb-unread-marks) + (elmo-msgdb-answered-marks) + (list elmo-msgdb-important-mark)))))) + (when mark-regexp + (if (eq flag 'read) + (dolist (number (elmo-msgdb-get-number-alist msgdb)) + (unless (string-match mark-regexp (elmo-msgdb-get-mark + msgdb number)) + (setq matched (cons number matched)))) + (dolist (elem (elmo-msgdb-get-mark-alist msgdb)) + (if (string-match mark-regexp (cadr elem)) + (setq matched (cons (car elem) matched)))))) + matched)) + (put 'elmo-msgdb-do-each-entity 'lisp-indent-function '1) (def-edebug-spec elmo-msgdb-do-each-entity ((symbolp form &rest form) &rest form))