* elmo-filter.el (elmo-folder-diff): Treat 'mark:' filter.
authorteranisi <teranisi>
Thu, 19 Sep 2002 06:16:12 +0000 (06:16 +0000)
committerteranisi <teranisi>
Thu, 19 Sep 2002 06:16:12 +0000 (06:16 +0000)
elmo/ChangeLog
elmo/elmo-filter.el

index cbe58ea..08ef145 100644 (file)
@@ -1,5 +1,7 @@
 2002-09-19  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * elmo-filter.el (elmo-folder-diff): Treat 'mark:' filter.
+
        * elmo.el (elmo-folder-unmark-read): Added argument `ignore-flag'.
 
        * elmo-filter.el (elmo-folder-unmark-read): Ditto.
index b8d29bb..aab8395 100644 (file)
 
 (luna-define-method elmo-folder-diff :around ((folder elmo-filter-folder)
                                              &optional numbers)
-  (if (not (and (vectorp (elmo-filter-folder-condition-internal
-                         folder))
-               (string-match "^last$"
-                             (elmo-filter-key
-                              (elmo-filter-folder-condition-internal
-                               folder)))))
-      (cons nil (cdr (elmo-folder-diff (elmo-filter-folder-target-internal
-                                       folder))))
-    (luna-call-next-method)))
+  (let ((condition (elmo-filter-folder-condition-internal folder))
+       diff)
+    (if (vectorp condition)
+       (cond
+        ((and (string= (elmo-filter-key condition) "mark")
+              (or (string= (elmo-filter-value condition) "any")
+                  (string= (elmo-filter-value condition) "unread")))
+         (setq diff (elmo-folder-diff (elmo-filter-folder-target-internal
+                                       folder)))
+         (if (consp diff)
+             (cons (car diff) (car diff))
+           (cons (car diff) (nth 1 diff))))
+        ((string-match "^last$" (elmo-filter-key condition))
+         (cons nil (cdr (elmo-folder-diff (elmo-filter-folder-target-internal
+                                           folder)))))
+        (t (luna-call-next-method)))
+      (luna-call-next-method))))
 
 (luna-define-method elmo-folder-status ((folder elmo-filter-folder))
   (elmo-folder-status
                                 numbers)
     (luna-call-next-method))
 
-
 (luna-define-method elmo-folder-unmark-important :around ((folder
                                                           elmo-filter-folder)
                                                          numbers)