* wl.el (wl-init): Setup faces accoding to wl-summary-flag-alist.
[elisp/wanderlust.git] / elmo / modb-standard.el
index 632c132..9bfcd09 100644 (file)
    (modb-standard-number-list-internal msgdb)))
 
 (luna-define-method elmo-msgdb-list-flagged ((msgdb modb-standard) flag)
-  (let (entry matched)
+  (let ((flags (case flag
+                (digest
+                 (nconc '(unread)(elmo-get-global-flags t t)))
+                (any
+                 (nconc '(unread answered)(elmo-get-global-flags t t)))))
+       entry matched)
     (case flag
       (read
        (dolist (number (modb-standard-number-list-internal msgdb))
         (unless (memq 'unread (modb-standard-message-flags msgdb number))
           (setq matched (cons number matched)))))
-      (digest
+      ((digest any)
        (mapatoms
        (lambda (atom)
          (setq entry (symbol-value atom))
-         (when (modb-standard-match-flags '(unread important)
-                                          (cdr entry))
-           (setq matched (cons (car entry) matched))))
-       (modb-standard-flag-map msgdb)))
-      (any
-       (mapatoms
-       (lambda (atom)
-         (setq entry (symbol-value atom))
-         (when (modb-standard-match-flags '(unread important answered)
-                                          (cdr entry))
+         (when (modb-standard-match-flags flags (cdr entry))
            (setq matched (cons (car entry) matched))))
        (modb-standard-flag-map msgdb)))
       (t
     (message "Sorting...done")
     msgdb))
 
-(luna-define-method elmo-msgdb-message-entity ((msgdb modb-standard) key)
-  (let ((ret (and key
-                 (elmo-get-hash-val
-                  (cond ((stringp key) key)
-                        ((numberp key) (modb-standard-key key)))
-                  (modb-standard-entity-map-internal msgdb)))))
-    (if (eq 'autoload (car-safe ret))
+(defun modb-standard-message-entity (msgdb key load)
+  (let ((ret (elmo-get-hash-val
+             key
+             (modb-standard-entity-map-internal msgdb))))
+    (if (and (eq 'autoload (car-safe ret)) load)
        (when modb-standard-divide-number
          (modb-standard-load-entity
           msgdb
           (elmo-msgdb-location msgdb)
           (/ (nth 1 ret) modb-standard-divide-number))
-         (elmo-get-hash-val
-          (cond ((stringp key) key)
-                ((numberp key) (modb-standard-key key)))
-          (modb-standard-entity-map-internal msgdb)))
+         (modb-standard-message-entity msgdb key nil))
       ret)))
 
+(luna-define-method elmo-msgdb-message-entity ((msgdb modb-standard) key)
+  (when key
+    (modb-standard-message-entity
+     msgdb
+     (cond ((stringp key) key)
+          ((numberp key) (modb-standard-key key)))
+     'autoload)))
+
 (require 'product)
 (product-provide (provide 'modb-standard) (require 'elmo-version))