Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* [PATCH] a trivial patch for using spamoracle with spam.el
@ 2007-08-01 13:07 Jean-Marc Lasgouttes
  0 siblings, 0 replies; only message in thread
From: Jean-Marc Lasgouttes @ 2007-08-01 13:07 UTC (permalink / raw)
  To: info-gnus-english

[-- 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-08-01 13:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-01 13:07 [PATCH] a trivial patch for using spamoracle with spam.el Jean-Marc Lasgouttes

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).