From: hmurata Date: Sat, 2 Sep 2006 01:47:31 +0000 (+0000) Subject: * elsp-bogofilter.el (elmo-spam-bogofilter-register-messages): Use X-Git-Tag: wl-2_15_4~3 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=bec1831269e385b9745d4892abf829c0e7cba990;p=elisp%2Fwanderlust.git * elsp-bogofilter.el (elmo-spam-bogofilter-register-messages): Use `elmo-spam-process-messages-as-mbox'. * elsp-sa.el (elmo-spam-spamassassin-register-messages): Ditto. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index ce6df16..ea1aa77 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,10 @@ +2006-09-02 Hiroya Murata + + * elsp-bogofilter.el (elmo-spam-bogofilter-register-messages): Use + `elmo-spam-process-messages-as-mbox'. + + * elsp-sa.el (elmo-spam-spamassassin-register-messages): Ditto. + 2006-08-27 Hiroya Murata * elsp-bsfilter.el (elsp-bsfilter-list-spam-files): Fix the diff --git a/elmo/elsp-bogofilter.el b/elmo/elsp-bogofilter.el index fd58ff8..8548650 100644 --- a/elmo/elsp-bogofilter.el +++ b/elmo/elsp-bogofilter.el @@ -127,26 +127,12 @@ Must be return a string or list of string." (if (not (< 0 elmo-spam-bogofilter-max-messages-per-process)) (error "\ non-positive value for `elmo-spam-bogofilter-max-messages-per-process'")) - (with-temp-buffer - (while numbers - (let ((count 0)) - (while (and numbers - (< count elmo-spam-bogofilter-max-messages-per-process)) - (insert "From MAILER-DAEMON\n" - (with-temp-buffer - (elmo-spam-message-fetch folder (car numbers)) - (goto-char (point-min)) - (while (re-search-forward "^>*From " nil t) - (goto-char (match-beginning 0)) - (insert ?>) - (forward-line)) - (buffer-substring (point-min) (point-max))) - "\n\n") - (setq count (1+ count) - numbers (cdr numbers))) - (elsp-bogofilter-register-buffer (current-buffer) spam restore) - (elmo-progress-notify 'elmo-spam-register count) - (erase-buffer))))) + (elmo-spam-process-messages-as-mbox + folder numbers elmo-spam-bogofilter-max-messages-per-process + (lambda (count spam restore) + (elsp-bogofilter-register-buffer (current-buffer) spam restore) + (elmo-progress-notify 'elmo-spam-register count)) + spam restore)) (luna-define-method elmo-spam-register-spam-messages :around ((processor elsp-bogofilter) folder &optional numbers restore) diff --git a/elmo/elsp-sa.el b/elmo/elsp-sa.el index 24fe6e3..47a1c82 100644 --- a/elmo/elsp-sa.el +++ b/elmo/elsp-sa.el @@ -111,31 +111,17 @@ spam restore) (if (not (< 0 elmo-spam-spamassassin-max-messages-per-process)) - (error - "non-positive value for `elmo-spam-spamassassin-max-messages-per-process'")) - (with-temp-buffer - (while numbers - (let ((count 0)) - (while (and numbers - (< count elmo-spam-spamassassin-max-messages-per-process)) - (insert "From MAILER-DAEMON@example.com\n" - (with-temp-buffer - (elmo-spam-message-fetch folder (car numbers)) - (goto-char (point-min)) - (while (re-search-forward "^>*From " nil t) - (goto-char (match-beginning 0)) - (insert ?>) - (forward-line)) - (buffer-substring (point-min) (point-max))) - "\n\n") - (setq count (1+ count) - numbers (cdr numbers))) - (apply 'elmo-spamassassin-call 'learn - (delq nil - (list "--mbox" - (if spam "--spam" "--ham")))) - (elmo-progress-notify 'elmo-spam-register count) - (erase-buffer))))) + (error "\ +non-positive value for `elmo-spam-spamassassin-max-messages-per-process'")) + (elmo-spam-process-messages-as-mbox + folder numbers elmo-spam-spamassassin-max-messages-per-process + (lambda (count spam restore) + (apply 'elmo-spamassassin-call 'learn + (delq nil + (list "--mbox" + (if spam "--spam" "--ham")))) + (elmo-progress-notify 'elmo-spam-register count)) + spam restore)) (luna-define-method elmo-spam-register-spam-messages :around ((processor elsp-sa) folder &optional numbers restore)