* elmo.el (elmo-msgdb-search): Use elmo-condition-in-msgdb-p instead
authorteranisi <teranisi>
Fri, 13 Jul 2001 14:56:59 +0000 (14:56 +0000)
committerteranisi <teranisi>
Fri, 13 Jul 2001 14:56:59 +0000 (14:56 +0000)
of elmo-condition-find-key.

* elmo-util.el (elmo-condition-in-msgdb-p-internal): New function.
(elmo-condition-in-msgdb-p): Ditto.
(elmo-read-search-condition-internal): Don't set REQUIRE-MATCH argument.

elmo/ChangeLog
elmo/elmo-util.el
elmo/elmo.el

index 827ccd1..b413170 100644 (file)
@@ -1,3 +1,13 @@
+2001-07-13  Yuuichi Teranishi  <teranisi@gohome.org>
+
+       * elmo.el (elmo-msgdb-search): Use elmo-condition-in-msgdb-p instead
+       of elmo-condition-find-key.
+
+       * elmo-util.el (elmo-condition-in-msgdb-p-internal): New function.
+       (elmo-condition-in-msgdb-p): Ditto.
+       (elmo-read-search-condition-internal): Don't set REQUIRE-MATCH
+       argument.
+
 2001-07-12  Yuuichi Teranishi  <teranisi@gohome.org>
 
        * elmo-pipe.el (elmo-folder-pack-numbers): Define.
index dbd4a5e..1b41b8f 100644 (file)
@@ -161,7 +161,7 @@ File content is encoded with MIME-CHARSET."
                                   "Since" "Before" "ToCc"
                                   "!From" "!Subject" "!To" "!Cc" "!Body"
                                   "!Since" "!Before" "!ToCc")
-                                elmo-msgdb-extra-fields)) nil t))
+                                elmo-msgdb-extra-fields))))
         value)
     (setq field (if (string= field "")
                    (setq field default)
@@ -859,20 +859,25 @@ Return value is a cons cell of (STRUCTURE . REST)"
        (setq result (not result)))
     result))
 
-(defun elmo-condition-find-key-internal (condition key)
+(defun elmo-condition-in-msgdb-p-internal (condition fields)
   (cond
    ((vectorp condition)
-    (if (string= (elmo-filter-key condition) key)
+    (if (not (member (elmo-filter-key condition) fields))
        (throw 'found t)))
    ((or (eq (car condition) 'and)
        (eq (car condition) 'or))
-    (elmo-condition-find-key-internal (nth 1 condition) key)
-    (elmo-condition-find-key-internal (nth 2 condition) key))))
-
-(defun elmo-condition-find-key (condition key)
-  (catch 'found
-    (elmo-condition-find-key-internal condition key)))
-
+    (elmo-condition-in-msgdb-p-internal (nth 1 condition) fields)
+    (elmo-condition-in-msgdb-p-internal (nth 2 condition) fields))))
+
+(defun elmo-condition-in-msgdb-p (condition)
+  (not (catch 'found
+        (elmo-condition-in-msgdb-p-internal condition
+                                            (append
+                                             elmo-msgdb-extra-fields
+                                             '("last" "first" "from"
+                                               "subject" "to" "cc" "since"
+                                               "before"))))))
 (defun elmo-buffer-field-condition-match (condition number number-list)
   (cond
    ((vectorp condition)
index ad59646..d5dbfef 100644 (file)
@@ -1294,7 +1294,7 @@ If update process is interrupted, return nil."
         (length (length overview))
         (i 0)
         result)
-    (if (elmo-condition-find-key condition "body")
+    (if (not (elmo-condition-in-msgdb-p condition))
        (elmo-folder-search folder condition number-list)
       (while overview
        (if (elmo-msgdb-search-internal condition (car overview)