nnimap-split-download-body, we add it to gnus-get-new-news-hook
(spam-list-of-statistical-checks): list of statistical splitter
checks
(spam-split): added a widen call when a statistical check is
enabled
+2003-02-28 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * spam.el (spam-setup-widening): new function to set
+ nnimap-split-download-body, we add it to gnus-get-new-news-hook
+ (spam-list-of-statistical-checks): list of statistical splitter
+ checks
+ (spam-split): added a widen call when a statistical check is
+ enabled
+
2003-02-28 Reiner Steib <Reiner.Steib@gmx.de>
* gnus-msg.el (gnus-user-agent): Changed default to
2003-02-28 Reiner Steib <Reiner.Steib@gmx.de>
* gnus-msg.el (gnus-user-agent): Changed default to
name is the value of `spam-split-group', meaning that the message is
definitely a spam.")
name is the value of `spam-split-group', meaning that the message is
definitely a spam.")
+(defvar spam-list-of-statistical-checks
+ '(spam-use-ifile spam-use-stat spam-use-bogofilter)
+"The spam-list-of-statistical-checks list contains all the mail
+splitters that need to have the full message body available.")
+
(defun spam-split ()
"Split this message into the `spam' group if it is spam.
This function can be used as an entry in `nnmail-split-fancy', for
(defun spam-split ()
"Split this message into the `spam' group if it is spam.
This function can be used as an entry in `nnmail-split-fancy', for
See the Info node `(gnus)Fancy Mail Splitting' for more details."
(interactive)
See the Info node `(gnus)Fancy Mail Splitting' for more details."
(interactive)
+
+ (dolist (check spam-list-of-statistical-checks)
+ (when (symbol-value check)
+ (widen)
+ (gnus-message 8 "spam-split: widening the buffer (%s requires it)"
+ (symbol-name check))
+ (return)))
+;; (progn (widen) (debug (buffer-string)))
(let ((list-of-checks spam-list-of-checks)
decision)
(while (and list-of-checks (not decision))
(let ((list-of-checks spam-list-of-checks)
decision)
(while (and list-of-checks (not decision))
(if (eq decision t)
nil
decision)))
(if (eq decision t)
nil
decision)))
+
+(defun spam-setup-widening ()
+ (dolist (check spam-list-of-statistical-checks)
+ (when (symbol-value check)
+ (setq nnimap-split-download-body t)
+ (return))))
+
+(add-hook 'gnus-get-new-news-hook 'spam-setup-widening)
+