From 492d2a113efb8ac8f1420df793120a1199d801a9 Mon Sep 17 00:00:00 2001 From: hmurata Date: Sat, 12 Mar 2005 04:05:51 +0000 Subject: [PATCH] * elmo-util.el (elmo-condition-in-msgdb-p-internal): Removed. (elmo-condition-in-msgdb-p): Ditto. (elmo-file-field-primitive-condition-match): Ditto. (elmo-file-field-condition-match): Ditto. * elmo-localdir.el (elmo-localdir-field-condition-match): Ditto. --- elmo/ChangeLog | 9 +++++++ elmo/elmo-localdir.el | 7 ----- elmo/elmo-util.el | 70 +++---------------------------------------------- 3 files changed, 12 insertions(+), 74 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 5f2ec52..64c7d06 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,12 @@ +2005-03-12 Hiroya Murata + + * elmo-util.el (elmo-condition-in-msgdb-p-internal): Removed. + (elmo-condition-in-msgdb-p): Ditto. + (elmo-file-field-primitive-condition-match): Ditto. + (elmo-file-field-condition-match): Ditto. + + * elmo-localdir.el (elmo-localdir-field-condition-match): Ditto. + 2005-03-11 Hiroya Murata * elmo-flag.el (elmo-folder-list-subfolders): Don't list from diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 5a2ea59..7d4a568 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -323,13 +323,6 @@ (rename-file old new) t)) -(defsubst elmo-localdir-field-condition-match (folder condition - number number-list) - (elmo-file-field-condition-match - (expand-file-name (int-to-string number) - (elmo-localdir-folder-directory-internal folder)) - condition number number-list)) - (luna-define-method elmo-folder-pack-numbers ((folder elmo-localdir-folder)) (let* ((dir (elmo-localdir-folder-directory-internal folder)) (msgdb (elmo-folder-msgdb folder)) diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 6147ca6..dbbe808 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -807,13 +807,13 @@ the directory becomes empty after deletion." `(or (vectorp ,filter) (consp ,filter))) (defmacro elmo-filter-type (filter) - (` (aref (, filter) 0))) + `(aref ,filter 0)) (defmacro elmo-filter-key (filter) - (` (aref (, filter) 1))) + `(aref ,filter 1)) (defmacro elmo-filter-value (filter) - (` (aref (, filter) 2))) + `(aref ,filter 2)) (defsubst elmo-buffer-field-primitive-condition-match (condition number @@ -864,25 +864,6 @@ the directory becomes empty after deletion." (setq result (not result))) result)) -(defun elmo-condition-in-msgdb-p-internal (condition fields) - (cond - ((vectorp condition) - (if (not (member (elmo-filter-key condition) fields)) - (throw 'found t))) - ((or (eq (car condition) 'and) - (eq (car condition) 'or)) - (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) @@ -899,51 +880,6 @@ the directory becomes empty after deletion." (elmo-buffer-field-condition-match (nth 2 condition) number number-list))))) -(defsubst elmo-file-field-primitive-condition-match (file - condition - number - number-list) - (let (result) - (goto-char (point-min)) - (cond - ((string= (elmo-filter-key condition) "last") - (setq result (<= (length (memq number number-list)) - (string-to-int (elmo-filter-value condition)))) - (if (eq (elmo-filter-type condition) 'unmatch) - (setq result (not result)))) - ((string= (elmo-filter-key condition) "first") - (setq result (< (- (length number-list) - (length (memq number number-list))) - (string-to-int (elmo-filter-value condition)))) - (if (eq (elmo-filter-type condition) 'unmatch) - (setq result (not result)))) - (t - (elmo-set-work-buf - (as-binary-input-file (insert-file-contents file)) - (set-buffer-multibyte default-enable-multibyte-characters) - ;; Should consider charset? - (decode-mime-charset-region (point-min)(point-max) elmo-mime-charset) - (setq result - (elmo-buffer-field-primitive-condition-match - condition number number-list))))) - result)) - -(defun elmo-file-field-condition-match (file condition number number-list) - (cond - ((vectorp condition) - (elmo-file-field-primitive-condition-match - file condition number number-list)) - ((eq (car condition) 'and) - (and (elmo-file-field-condition-match - file (nth 1 condition) number number-list) - (elmo-file-field-condition-match - file (nth 2 condition) number number-list))) - ((eq (car condition) 'or) - (or (elmo-file-field-condition-match - file (nth 1 condition) number number-list) - (elmo-file-field-condition-match - file (nth 2 condition) number number-list))))) - (defmacro elmo-get-hash-val (string hashtable) (static-if (fboundp 'unintern) `(symbol-value (intern-soft ,string ,hashtable)) -- 1.7.10.4