From 6ab626ca1c00df2605d2ab0a0b813aaf83bc4cb4 Mon Sep 17 00:00:00 2001 From: teranisi Date: Fri, 13 Jul 2001 15:00:35 +0000 Subject: [PATCH] * elmo2.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. --- elmo/ChangeLog | 10 ++++++++++ elmo/elmo-util.el | 25 +++++++++++++++---------- elmo/elmo2.el | 2 +- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 6a8b2e9..95d7427 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,13 @@ +2001-07-13 Yuuichi Teranishi + + * elmo2.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-05 Yuuichi Teranishi * elmo-imap4.el (elmo-imap4-find-next-line): Fixed diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index e509e3d..6ee19ef 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -508,7 +508,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) @@ -1339,20 +1339,25 @@ Otherwise treat \\ in NEWTEXT string as special: (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) diff --git a/elmo/elmo2.el b/elmo/elmo2.el index b018394..ae82a7e 100644 --- a/elmo/elmo2.el +++ b/elmo/elmo2.el @@ -404,7 +404,7 @@ If optional UNREAD is non-nil, message is keeped as unread." (length (length overview)) (i 0) result) - (if (elmo-condition-find-key condition "body") + (if (not (elmo-condition-in-msgdb-p condition)) (elmo-search folder condition number-list) (while overview (if (elmo-msgdb-search-internal condition (car overview) -- 1.7.10.4