From: yamaoka Date: Sun, 13 Oct 2002 13:05:34 +0000 (+0000) Subject: Synch with Oort Gnus. X-Git-Tag: t-gnus-6_15_8-05-quimby~37 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fd899025dbe59b095af0f662c9c171f2fee4167;p=elisp%2Fgnus.git- Synch with Oort Gnus. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8b630b9..5525533 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,22 @@ +2002-10-11 Ted Zlatanov + + * spam.el (spam-check-ifile): added ifile as a spam checking + backend, and spam-use-ifle as the variable to toggle that check. + +2002-10-12 Simon Josefsson + + * message.el (message-beginning-of-line): New variable. + (message-beginning-of-line): Use it. + +2002-10-11 Ted Zlatanov + + * spam.el: more compilation fixes for BBDB + + * spam-stat.el added code from Alex Schroeder + (spam-stat-reduce-size): Interactive. + (spam-stat-reset): New function. + (spam-stat-save): Interactive. + 2002-10-11 Katsumi Yamaoka * gnus.el: Autoload gnus-delay-initialize. diff --git a/lisp/message.el b/lisp/message.el index d007624..6218a32 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -5365,13 +5365,19 @@ than 988 characters long, and if they are not, trim them until they are." (forward-line 2))) (sit-for 0))) +(defcustom message-beginning-of-line t + "Whether C-a goes to beginning of header values." + :group 'message-buffers + :type 'boolean) + (defun message-beginning-of-line (&optional n) "Move point to beginning of header value or to beginning of line." (interactive "p") (let ((zrs 'zmacs-region-stays)) (when (and (interactive-p) (boundp zrs)) (set zrs t))) - (if (message-point-in-header-p) + (if (and message-beginning-of-line + (message-point-in-header-p)) (let* ((here (point)) (bol (progn (beginning-of-line n) (point))) (eol (gnus-point-at-eol)) diff --git a/lisp/spam-stat.el b/lisp/spam-stat.el index 70d20bc..38fd9b7 100644 --- a/lisp/spam-stat.el +++ b/lisp/spam-stat.el @@ -4,7 +4,7 @@ ;; Author: Alex Schroeder ;; Maintainer: Alex Schroeder -;; Version: 0.3.3 +;; Version: 0.3.4 ;; Keywords: spam filtering gnus ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SpamStat @@ -353,6 +353,7 @@ Use `spam-stat-ngood', `spam-stat-nbad', `spam-stat-good', (defun spam-stat-save () "Save the `spam-stat' hash table as lisp file." + (interactive) (with-temp-buffer (let ((standard-output (current-buffer))) (insert "(setq spam-stat (spam-stat-to-hash-table '(") @@ -387,6 +388,12 @@ has appeared in bad mails." entries) table)) +(defun spam-stat-reset () + "Reset `spam-stat' to an empty hash-table. +This deletes all the statistics." + (interactive) + (setq spam-stat (make-hash-table :test 'equal))) + ;; Scoring buffers (defvar spam-stat-score-data nil @@ -506,6 +513,7 @@ This removes all words that occur less than COUNT from the dictionary. COUNT defaults to 5. It also removes all words whose spam score is less than DISTANCE from 0.5. DISTANCE defaults to 0.1, meaning that all words with score between 0.4 and 0.6 are removed." + (interactive) (setq count (or count 5) distance (or distance 0.1)) (maphash (lambda (key entry) diff --git a/lisp/spam.el b/lisp/spam.el index 8138b7f..e6a54f8 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -45,12 +45,14 @@ (eval-when-compile (condition-case nil (require 'bbdb-com) - (file-error (defalias 'bbdb-search 'ignore)) - (error))) + (file-error (defalias 'bbdb-search 'ignore)))) ;; autoload executable-find (autoload 'executable-find "executable") +;; autoload ifile-spam-filter +(autoload 'ifile-spam-filter "ifile-gnus") + ;;; Main parameters. (defvar spam-use-blacklist t @@ -66,6 +68,12 @@ (defvar spam-use-bogofilter t "True if bogofilter should be used.") +(defvar spam-use-bbdb t + "True if BBDB should be used.") + +(defvar spam-use-bbdb t + "True if ifile should be used.") + (defvar spam-split-group "spam" "Usual group name where spam should be split.") @@ -154,23 +162,25 @@ Such articles will be transmitted to `bogofilter -s' on group exit.") ;;;; Spam determination. -;; The following list contains pairs associating a parameter variable with a -;; spam checking function. If the parameter variable is true, then the -;; checking function is called, and its value decides what happens. Each -;; individual check may return `nil', `t', or a mailgroup name. The value -;; `nil' means that the check does not yield a decision, and so, that further -;; checks are needed. The value `t' means that the message is definitely not -;; spam, and that further spam checks should be inhibited. Otherwise, a -;; mailgroup name is returned where the mail 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-checks '((spam-use-blacklist . spam-check-blacklist) (spam-use-whitelist . spam-check-whitelist) (spam-use-bbdb . spam-check-bbdb) + (spam-use-ifile . spam-check-ifile) (spam-use-blackholes . spam-check-blackholes) - (spam-use-bogofilter . spam-check-bogofilter))) + (spam-use-bogofilter . spam-check-bogofilter)) +"The spam-list-of-checks list contains pairs associating a parameter +variable with a spam checking function. If the parameter variable is +true, then the checking function is called, and its value decides what +happens. Each individual check may return `nil', `t', or a mailgroup +name. The value `nil' means that the check does not yield a decision, +and so, that further checks are needed. The value `t' means that the +message is definitely not spam, and that further spam checks should be +inhibited. Otherwise, a mailgroup name is returned where the mail +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.") (defun spam-split () "Split this message into the `spam' group if it is spam. @@ -272,18 +282,31 @@ The regular expression is matched against the address.") (setq spam-whitelist-cache (spam-parse-list spam-whitelist))) (if (spam-from-listed-p spam-whitelist-cache) nil spam-split-group)) -;;; copied from code by Alexander Kotelnikov -(defun spam-check-bbdb () - "We want messages from people who are in the BBDB not to be split to spam" - (let ((who (message-fetch-field "from"))) - (when who - (setq who (regexp-quote (cadr (gnus-extract-address-components who)))) - (if (bbdb-search (bbdb-records) nil nil who) nil spam-split-group)))) - -;; let spam-check-bbdb be nil if the BBDB can't be loaded +;;; original idea from Alexander Kotelnikov +(condition-case nil + (progn + (require 'bbdb-com) + (defun spam-check-bbdb () + "We want messages from people who are in the BBDB not to be split to spam" + (let ((who (message-fetch-field "from"))) + (when who + (setq who (regexp-quote (cadr (gnus-extract-address-components who)))) + (if (bbdb-search (bbdb-records) nil nil who) nil spam-split-group))))) + (file-error (setq spam-list-of-checks + (delete (assoc 'spam-use-bbdb spam-list-of-checks) + spam-list-of-checks)))) + +;;; check the ifile backend; return nil if the mail was NOT classified as spam (condition-case nil - (require 'bbdb) - (file-error (defalias 'spam-check-bbdb 'ignore))) + (progn + (require 'ifile-gnus) + ;;; + (defun spam-check-ifile () + (let ((ifile-primary-spam-group spam-split-group)) + (ifile-spam-filter nil)))) + (file-error (setq spam-list-of-checks + (delete (assoc 'spam-use-ifile spam-list-of-checks) + spam-list-of-checks)))) (defun spam-check-blacklist () ;; FIXME! Should it detect when file timestamps change? diff --git a/texi/ChangeLog b/texi/ChangeLog index 0beab05..00fb340 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,7 @@ +2002-10-12 Simon Josefsson + + * message.texi (Movement): Add. + 2002-10-11 Jesper harder * gnus.texi (Formatting Fonts): Fix for balloon help in GNU Emacs. diff --git a/texi/message-ja.texi b/texi/message-ja.texi index 8a2a4af..700e3ca 100644 --- a/texi/message-ja.texi +++ b/texi/message-ja.texi @@ -640,8 +640,11 @@ MFT $B$rB:=E$9$k$3$H$ONI$$%M%A%1%C%H(B (nettiquette) $B$G$"$k$H9M$($i$l$F$$$^ @item C-a @kindex C-a @findex message-beginning-of-line +@vindex message-beginning-of-line $B%X%C%@!<$NCM$N$H$3$m$K$$$k$H$-$O9T$N@hF,$K0\F0$7!"$=$&$G$J$$$H$-$O%X%C%@!<(B -$B$NCM$N@hF,$K0\F0$7$^$9!#(B($B%X%C%@!<$NCM$O%X%C%@!$H%3%m%s$N8e$KMh$^$9!#(B) +$B$NCM$N@hF,$K0\F0$7$^$9!#(B($B%X%C%@!<$NCM$O%X%C%@!$H%3%m%s$N8e$KMh$^(B +$B$9!#(B) $B$3$NF0:n$OJQ?t(B @code{message-beginning-of-line} $B$r%H%0%k$9$k$3$H$K(B +$B$h$C$FL58z$K$9$k$3$H$,$G$-$^$9!#(B @end table @node Insertion diff --git a/texi/message.texi b/texi/message.texi index 5ea0daa..cd8c147 100644 --- a/texi/message.texi +++ b/texi/message.texi @@ -625,9 +625,11 @@ Move to the signature of the message (@code{message-goto-signature}). @item C-a @kindex C-a @findex message-beginning-of-line +@vindex message-beginning-of-line If at beginning of header value, go to beginning of line, else go to beginning of header value. (The header value comes after the header -name and the colon.) +name and the colon.) This behaviour can be disabled by toggling +the variable @code{message-beginning-of-line}. @end table