From: yamaoka Date: Sat, 26 Jul 2003 13:41:01 +0000 (+0000) Subject: Synch to Gnus 200307260957. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=884f76b026ae27c92b12ae2539a4919bcdefc1cb;p=elisp%2Fgnus.git- Synch to Gnus 200307260957. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cab38a0..8d61fb4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,24 @@ +2003-07-26 Kai Gro,A_(Bjohann + + * flow-fill.el (fill-flowed): Empty lines separate paragraphs + even if the preceding line ends with a soft break. Tiny patch + from Mark Thomas . + +2003-07-25 Teodor Zlatanov + + * spam.el (spam-use-regex-body, spam-regex-body-spam) + (spam-regex-body-ham): new variables, default to nil/empty/empty + (spam-install-hooks): added spam-use-regex-body to list or + pre-install conditions + (spam-list-of-checks): added spam-use-regex-body and + spam-check-regex-body to list of checks + (spam-list-of-statistical-checks): added spam-use-regex-body to + list of statistical checks + (spam-check-regex-body): invokes spam-check-regex-headers with + appropriate variable masking + (spam-check-regex-headers): changes to print "body" or "header" + where appropriate + 2003-07-25 Jesper Harder * smime.el (smime-ask-passphrase): Use read-passwd rather than diff --git a/lisp/flow-fill.el b/lisp/flow-fill.el index ea95fb3..c4dcf00 100644 --- a/lisp/flow-fill.el +++ b/lisp/flow-fill.el @@ -127,7 +127,7 @@ RFC 2646 suggests 66 characters for readability." (save-excursion (unless (eobp) (forward-char 1) - (looking-at (format "^\\(%s\\)\\([^>]\\)" + (looking-at (format "^\\(%s\\)\\([^>\n\r]\\)" (or quote " ?")))))) (save-excursion (replace-match (if (string= (match-string 2) " ") diff --git a/lisp/spam.el b/lisp/spam.el index 1f73204..6d25e7e 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -155,6 +155,12 @@ Also see the variables `spam-regex-headers-spam' and `spam-regex-headers-ham'." :type 'boolean :group 'spam) +(defcustom spam-use-regex-body nil + "Whether a body regular expression match should be used by spam-split. +Also see the variables `spam-regex-body-spam' and `spam-regex-body-ham'." + :type 'boolean + :group 'spam) + (defcustom spam-use-bogofilter-headers nil "Whether bogofilter headers should be used by spam-split. Enable this if you pre-process messages with Bogofilter BEFORE Gnus sees them." @@ -202,6 +208,7 @@ considered spam." spam-use-blackholes spam-use-hashcash spam-use-regex-headers + spam-use-regex-body spam-use-bogofilter-headers spam-use-bogofilter spam-use-BBDB @@ -252,6 +259,16 @@ All unmarked article in such group receive the spam mark on group entry." :type '(repeat (regexp :tag "Regular expression to match ham header")) :group 'spam) +(defcustom spam-regex-body-spam '() + "Regular expression for positive body spam matches" + :type '(repeat (regexp :tag "Regular expression to match spam body")) + :group 'spam) + +(defcustom spam-regex-body-ham '() + "Regular expression for positive body ham matches" + :type '(repeat (regexp :tag "Regular expression to match ham body")) + :group 'spam) + (defgroup spam-ifile nil "Spam ifile configuration." :group 'spam) @@ -648,6 +665,7 @@ spamoracle database." (defvar spam-list-of-checks '((spam-use-blacklist . spam-check-blacklist) (spam-use-regex-headers . spam-check-regex-headers) + (spam-use-regex-body . spam-check-regex-body) (spam-use-whitelist . spam-check-whitelist) (spam-use-BBDB . spam-check-BBDB) (spam-use-ifile . spam-check-ifile) @@ -670,10 +688,11 @@ 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 spam-use-spamoracle) + '(spam-use-ifile spam-use-regex-body spam-use-stat spam-use-bogofilter spam-use-spamoracle) "The spam-list-of-statistical-checks list contains all the mail splitters that need to have the full message body available.") +;;;TODO: modify to invoke self with each specific check if invoked without specific checks (defun spam-split (&rest specific-checks) "Split this message into the `spam' group if it is spam. This function can be used as an entry in `nnmail-split-fancy', for @@ -709,21 +728,30 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." (setq nnimap-split-download-body-default t)))) +;;;; Regex body + +(defun spam-check-regex-body () + (let ((spam-regex-headers-ham spam-regex-body-ham) + (spam-regex-headers-spam spam-regex-body-spam)) + (spam-check-regex-headers t))) + + ;;;; Regex headers -(defun spam-check-regex-headers () - (let (ret found) +(defun spam-check-regex-headers (&optional body) + (let ((type (if body "body" "header")) + ret found) (dolist (h-regex spam-regex-headers-ham) (unless found (goto-char (point-min)) (when (re-search-forward h-regex nil t) - (message "Ham regex header search positive.") + (message "Ham regex %s search positive." type) (setq found t)))) (dolist (s-regex spam-regex-headers-spam) (unless found (goto-char (point-min)) (when (re-search-forward s-regex nil t) - (message "Spam regex header search positive." (match-string 1)) + (message "Spam regex %s search positive." type) (setq found t) (setq ret spam-split-group)))) ret))