From 78d559cdec75ba74a49dd053dc65888e983b5a1e Mon Sep 17 00:00:00 2001 From: Teodor Zlatanov Date: Fri, 28 Feb 2003 21:33:47 +0000 Subject: [PATCH] (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 --- lisp/ChangeLog | 9 +++++++++ lisp/spam.el | 23 ++++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1825d1cdf..4f2ddb5b9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2003-02-28 Teodor Zlatanov + + * 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 * gnus-msg.el (gnus-user-agent): Changed default to diff --git a/lisp/spam.el b/lisp/spam.el index aa46c67d3..338183f4b 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -562,6 +562,11 @@ should go, and further checks are also inhibited. The usual mailgroup 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 @@ -569,7 +574,14 @@ example like this: (: spam-split) 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)) @@ -580,6 +592,15 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." (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) + ;;;; Regex headers -- 2.34.1