X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=elmo%2Felmo-split.el;h=57bf96692581818475b392bad6343ff81b135f9e;hb=4714b47d522eb2cd84968a3b244bf187cd8e16ae;hp=500d61d337a6ba96a0e7bf22dfb8b5585e3c27bb;hpb=a92395308e5d13f611456b8df3c611a882b04a52;p=elisp%2Fwanderlust.git diff --git a/elmo/elmo-split.el b/elmo/elmo-split.el index 500d61d..57bf966 100644 --- a/elmo/elmo-split.el +++ b/elmo/elmo-split.el @@ -38,6 +38,7 @@ ;; ;;; Code: +(eval-when-compile (require 'cl)) (require 'elmo) (eval-when-compile @@ -76,9 +77,13 @@ FIELD-NAME is a symbol of the field name. `or' ... True if one of the argument returns true. `and' ... True if all of the arguments return true. -4. Functions which accept not argument. - `spam-p' ... True if contents of the message is guessed as spam. + Rest arguments are property list which consists + following. + + `:register' ... If this value is non-nil, + Register according to + the classification. 5. A symbol. @@ -286,7 +291,8 @@ If prefix argument ARG is specified, do a reharsal (no harm)." (format "%d messages are splitted" count))) (if (eq fcount 0) "." - (format " (%d failure)." fcount)))))) + (format " (%d failure)." fcount)))) + count)) (defun elmo-split-subr (folder &optional reharsal) (let ((elmo-inhibit-display-retrieval-progress t) @@ -294,7 +300,7 @@ If prefix argument ARG is specified, do a reharsal (no harm)." (fcount 0) (default-rule `((t ,elmo-split-default-action))) msgs action target-folder failure delete-substance - record-log log-string) + record-log log-string flags) (message "Splitting...") (elmo-folder-open-internal folder) (setq msgs (elmo-folder-list-messages folder)) @@ -310,6 +316,9 @@ If prefix argument ARG is specified, do a reharsal (no harm)." nil (current-buffer) 'unread)) (run-hooks 'elmo-split-fetch-hook) (setq elmo-split-message-entity (mime-parse-buffer)) + (setq flags (or (elmo-message-flags folder msg) + (and (elmo-message-entity folder msg) + '(read)))) (catch 'terminate (dolist (rule (append elmo-split-rule default-rule)) (setq elmo-split-match-string-internal nil) @@ -341,7 +350,10 @@ If prefix argument ARG is specified, do a reharsal (no harm)." action))) (elmo-folder-create target-folder))) (elmo-folder-open-internal target-folder) - (elmo-folder-append-buffer target-folder) + (setq failure (not + (elmo-folder-append-buffer + target-folder + flags))) (elmo-folder-close-internal target-folder)) (error (setq failure t) (incf fcount)))