From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/9440 Path: news.gmane.org!not-for-mail From: Jean-Marc Lasgouttes Newsgroups: gmane.emacs.gnus.user Subject: [PATCH] a trivial patch for using spamoracle with spam.el Date: Wed, 01 Aug 2007 15:07:38 +0200 Organization: INRIA, Rocquencourt, BP 105, 78153 Le Chesnay Cedex, France Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1185988159 31590 80.91.229.12 (1 Aug 2007 17:09:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 1 Aug 2007 17:09:19 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Wed Aug 01 19:09:12 2007 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IGHh9-0008HE-95 for gegu-info-gnus-english@m.gmane.org; Wed, 01 Aug 2007 19:09:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IGHh8-0008CT-Mn for gegu-info-gnus-english@m.gmane.org; Wed, 01 Aug 2007 13:09:10 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!feeder1-2.proxad.net!news.cs.univ-paris8.fr!ciril.fr!news-rocq.inria.fr!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-Lines: 81 Original-NNTP-Posting-Host: pegase.inria.fr Original-X-Trace: news-rocq.inria.fr 1185973658 16567 128.93.52.47 (1 Aug 2007 13:07:38 GMT) Original-X-Complaints-To: usenet@inria.fr Original-NNTP-Posting-Date: Wed, 1 Aug 2007 13:07:38 +0000 (UTC) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:B7ecQe0iauBmkqpECpD4GbQxeY4= Original-Xref: shelby.stanford.edu gnu.emacs.gnus:79628 X-Mailman-Approved-At: Wed, 01 Aug 2007 13:09:07 -0400 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:9440 Archived-At: --=-=-= 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=no-article.diff 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) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ info-gnus-english mailing list info-gnus-english@gnu.org http://lists.gnu.org/mailman/listinfo/info-gnus-english --=-=-=--