From 57bc66ef959d500bf2cd295957a0f3f1c2c42398 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Fri, 7 Mar 2003 02:29:43 +0000 Subject: [PATCH] Synch to Oort Gnus. --- lisp/ChangeLog | 22 ++++++++++++++++++++++ lisp/gnus-agent.el | 6 ++++-- lisp/gnus-group.el | 1 + lisp/gnus-start.el | 5 +++++ lisp/spam.el | 18 +++++++++++++++--- 5 files changed, 47 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 873a26f..7e261c6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,25 @@ +2003-03-06 Kevin Greiner + + * gnus-agent.el (gnus-agent-fetch-group-1): Added default + predicate of `false' to avoid an error when a group defines no + predicate. Fixed typo that disabled agent scoring (i.e. the + low/high predicates should now work). + +2003-03-06 Teodor Zlatanov + + * spam.el: add spam-maybe-spam-stat-load to + gnus-get-top-new-news-hook, remove it from gnus-get-new-news-hook + (spam-bogofilter-register-with-bogofilter): use + spam-bogofilter-spam-switch and spam-bogofilter-ham-switch + (spam-bogofilter-spam-switch, spam-bogofilter-ham-switch): new + custom variables to replace "-s" and "-n" + + * gnus-group.el (gnus-group-get-new-news): call the new + gnus-get-top-new-news-hook hook + + * gnus-start.el (gnus-get-top-new-news-hook): new hook, run ONLY + by gnus-get-new-news, NOT by gnus-group-get-new-news-this-group + 2003-03-06 Lars Magne Ingebrigtsen * mm-uu.el (mm-uu-pgp-encrypted-test): Fix message. diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index 1dae0e3..4342209 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -1840,14 +1840,16 @@ FILE and places the combined headers into `nntp-server-buffer'." ;; Figure out how to select articles in this group (setq category (gnus-group-category group)) + (debug) (setq predicate (gnus-get-predicate - (gnus-agent-find-parameter group 'agent-predicate))) + (or (gnus-agent-find-parameter group 'agent-predicate) + 'false))) ;; If the selection predicate requires scoring, score each header (unless (memq predicate '(gnus-agent-true gnus-agent-false)) (let ((score-param - (gnus-agent-find-parameter group 'agent-score))) + (gnus-agent-find-parameter group 'agent-score-file))) ;; Translate score-param into real one (cond ((not score-param)) diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index 09d7a92..e604886 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -3532,6 +3532,7 @@ re-scanning. If ARG is non-nil and not a number, this will force ;; Binding this variable will inhibit multiple fetchings ;; of the same mail source. (nnmail-fetched-sources (list t))) + (gnus-run-hooks 'gnus-get-top-new-news-hook) (gnus-run-hooks 'gnus-get-new-news-hook) ;; Read any slave files. diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el index 60039cd..c1a5ec2 100644 --- a/lisp/gnus-start.el +++ b/lisp/gnus-start.el @@ -395,6 +395,11 @@ This hook is called as the first thing when Gnus is started." :group 'gnus-start :type 'hook) +(defcustom gnus-get-top-new-news-hook nil + "A hook run just before Gnus checks for new news globally." + :group 'gnus-group-new + :type 'hook) + (defcustom gnus-get-new-news-hook nil "A hook run just before Gnus checks for new news." :group 'gnus-group-new diff --git a/lisp/spam.el b/lisp/spam.el index a3ae80d..eccdea9 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -259,6 +259,16 @@ your main source of newsgroup names." :type 'string :group 'spam-bogofilter) +(defcustom spam-bogofilter-spam-switch "-s" + "The switch that Bogofilter uses to register spam messages." + :type 'string + :group 'spam-bogofilter) + +(defcustom spam-bogofilter-ham-switch "-n" + "The switch that Bogofilter uses to register ham messages." + :type 'string + :group 'spam-bogofilter) + (defcustom spam-bogofilter-bogosity-positive-spam-header "^\\(Yes\\|Spam\\)" "The regex on `spam-bogofilter-header' for positive spam identification." :type 'regexp @@ -645,7 +655,8 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." (if spam-use-dig (let ((query-result (query-dig query-string))) (when query-result - (gnus-message 5 "(DIG): positive blackhole check '%s'" query-result) + (gnus-message 5 "(DIG): positive blackhole check '%s'" + query-result) (push (list ip server query-result) matches))) ;; else, if not using dig.el @@ -815,7 +826,7 @@ Uses `gnus-newsgroup-name' if category is nil (for ham registration)." ;; Add hooks for loading and saving the spam stats (add-hook 'gnus-save-newsrc-hook 'spam-maybe-spam-stat-save) - (add-hook 'gnus-get-new-news-hook 'spam-maybe-spam-stat-load) + (add-hook 'gnus-get-top-new-news-hook 'spam-maybe-spam-stat-load) (add-hook 'gnus-startup-hook 'spam-maybe-spam-stat-load)) (file-error (progn @@ -966,7 +977,8 @@ Uses `gnus-newsgroup-name' if category is nil (for ham registration)." (defun spam-bogofilter-register-with-bogofilter (article-string spam) "Register an article, given as a string, as spam or non-spam." (when (stringp article-string) - (let ((switch (if spam "-s" "-n"))) + (let ((switch (if spam spam-bogofilter-spam-switch + spam-bogofilter-ham-switch))) (with-temp-buffer (insert article-string) (if spam-bogofilter-database-directory -- 1.7.10.4