Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
To: info-gnus-english@gnu.org
Subject: [PATCH] a trivial patch for using spamoracle with spam.el
Date: Wed, 01 Aug 2007 15:07:38 +0200	[thread overview]
Message-ID: <liyejin7691.fsf@pegase.inria.fr> (raw)

[-- Attachment #1: Type: text/plain, Size: 928 bytes --]


Hello,

I am using spamoracle to filter my spam (mainly because this is a
local product from inria), and have been very annoyed by the fact
that, when quitting a mail group, I see the message
  Registering 0 articles with classification spam, check spam-use-spamoracle

The problem is that spamoracle suffers from slow startup even when no
messages are passed to it and the maessage slows down gnus operation.
And anyway it seems kind of pointless.

I finally came up with the following trivial patch, which only
encloses the relevant code into a "(when articles ...)" block. I have
been using it for a year without problem. I do not know whether it can
cause problems to other spam filter, but it looks to me like a
reasonable thing to do anyway.

I am not sure whether this group is the right place to submit such a
patch. Please tell me where to send it and whether a different form
(changelog?) is needed.

Regards,
JMarc


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: no-article.diff --]
[-- Type: text/x-patch, Size: 1730 bytes --]

Index: lisp/spam.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/spam.el,v
retrieving revision 6.146.2.22
diff -u -p -r6.146.2.22 spam.el
--- lisp/spam.el	24 Jan 2007 07:17:41 -0000	6.146.2.22
+++ lisp/spam.el	1 Aug 2007 12:52:36 -0000
@@ -1108,22 +1108,23 @@ functions")
 			   (spam-list-articles
 			    gnus-newsgroup-articles
 			    classification)))
-	;; process them
-	(gnus-message 5 "%s %d %s articles with classification %s, check %s"
-		      (if unregister "Unregistering" "Registering")
-		      (length articles)
-		      (if specific-articles "specific" "")
-		      (symbol-name classification)
-		      (symbol-name check))
-	(funcall run-function articles)
-	;; now log all the registrations (or undo them, depending on unregister)
-	(dolist (article articles)
-	  (funcall log-function
-		   (spam-fetch-field-message-id-fast article)
-		   'process
-		   classification
-		   check
-		   gnus-newsgroup-name))))))
+	(when articles
+	  ;; process them
+	  (gnus-message 5 "%s %d %s articles with classification %s, check %s"
+			(if unregister "Unregistering" "Registering")
+			(length articles)
+			(if specific-articles "specific" "")
+			(symbol-name classification)
+			(symbol-name check))
+	  (funcall run-function articles)
+	  ;; now log all the registrations (or undo them, depending on unregister)
+	  (dolist (article articles)
+	    (funcall log-function
+		     (spam-fetch-field-message-id-fast article)
+		     'process
+		     classification
+		     check
+		     gnus-newsgroup-name)))))))
 
 ;;; log a ham- or spam-processor invocation to the registry
 (defun spam-log-processing-to-registry (id type classification check group)

[-- Attachment #3: Type: text/plain, Size: 161 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
http://lists.gnu.org/mailman/listinfo/info-gnus-english

                 reply	other threads:[~2007-08-01 13:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=liyejin7691.fsf@pegase.inria.fr \
    --to=jean-marc.lasgouttes@inria.fr \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).