From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/57568 Path: main.gmane.org!not-for-mail From: TSUCHIYA Masatoshi Newsgroups: gmane.emacs.gnus.general Subject: Re: [spam.el] Misleading messages on group exit Date: Thu, 20 May 2004 11:29:47 +0900 Sender: ding-owner@lists.math.uh.edu Message-ID: <878yfn4yqs.fsf@pine.kuee.kyoto-u.ac.jp> References: <877jvjjwq9.fsf@namazu.org> <87r7tqs03q.fsf@namazu.org> <4nn04ake2n.fsf@lifelogs.com> <873c604b8n.fsf@namazu.org> <4nu0yfuopr.fsf@lifelogs.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1085020244 20442 80.91.224.253 (20 May 2004 02:30:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 May 2004 02:30:44 +0000 (UTC) Original-X-From: ding-owner+M6108@lists.math.uh.edu Thu May 20 04:30:34 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BQdKM-0000DQ-00 for ; Thu, 20 May 2004 04:30:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1BQdJy-0005C8-00; Wed, 19 May 2004 21:30:10 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1BQdJp-0005C2-00 for ding@lists.math.uh.edu; Wed, 19 May 2004 21:30:01 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1BQdJm-0008L0-QI for ding@lists.math.uh.edu; Wed, 19 May 2004 21:29:58 -0500 Original-Received: from pine.kuee.kyoto-u.ac.jp (pine.kuee.kyoto-u.ac.jp [130.54.208.130]) by justine.libertine.org (Postfix) with SMTP id 061973A006A for ; Wed, 19 May 2004 21:29:57 -0500 (CDT) Original-Received: (qmail 9091 invoked from network); 20 May 2004 02:29:48 -0000 Original-Received: from unknown (HELO pine.kuee.kyoto-u.ac.jp) (130.54.208.130) by pine.kuee.kyoto-u.ac.jp with SMTP; 20 May 2004 02:29:48 -0000 Original-To: ding@gnus.org X-cite: xcite 1.49 Mail-Followup-To: ding@gnus.org User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) X-Dispatcher: imput version 20031028(IM146) Original-Lines: 125 Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:57568 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:57568 --=-=-= >> On 17 May 2004 10:12:48 -0400 >> tzz@lifelogs.com ("Ted Zlatanov") said as follows: >> Your fix is as insufficient as my proposal, I think. >Can you be specific as to why? The reason was quite simple: both my proposed patch and your fix did not cover all misleading messages. >I tried to fix those as well. Fixes in CVS - let me know what you >think. They work fine. However, I am afraid that the condition to display status messages may conflict with the condition to process articles in spam/ham processing routines in the future. So, I'd like to propose the attached change, which simplifies the condition to display status messages. -- TSUCHIYA Masatoshi --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- spam.el 17 May 2004 14:28:21 -0000 7.37 +++ spam.el 20 May 2004 02:08:44 -0000 @@ -861,22 +861,21 @@ (unless (and spam-move-spam-nonspam-groups-only (spam-group-spam-contents-p gnus-newsgroup-name)) - (when (< 0 (length (spam-list-articles - gnus-newsgroup-articles - 'spam))) - (gnus-message 6 "Marking spam as expired and moving it to %s" - (gnus-parameter-spam-process-destination - gnus-newsgroup-name)) - (spam-mark-spam-as-expired-and-move-routine - (gnus-parameter-spam-process-destination gnus-newsgroup-name)))) + (let* ((group (gnus-parameter-spam-process-destination + gnus-newsgroup-name)) + (num (spam-mark-spam-as-expired-and-move-routine group))) + (when (> num 0) + (gnus-message 6 + "%d spam messages are marked as expired and moved it to %s" + num group)))) ;; now we redo spam-mark-spam-as-expired-and-move-routine to only ;; expire spam, in case the above did not expire them - (when (< 0 (length (spam-list-articles - gnus-newsgroup-articles - 'spam))) - (gnus-message 6 "Marking spam as expired without moving it") - (spam-mark-spam-as-expired-and-move-routine nil)) + (let ((num (spam-mark-spam-as-expired-and-move-routine nil))) + (when (> num 0) + (gnus-message 6 + "%d spam messages are markd as expired without moving it" + num))) (when (or (spam-group-ham-contents-p gnus-newsgroup-name) (and (spam-group-spam-contents-p gnus-newsgroup-name) @@ -891,19 +890,20 @@ (spam-group-processor-p gnus-newsgroup-name processor)) (spam-register-routine classification check))))) - (when (< 0 (length (spam-list-articles - gnus-newsgroup-articles - 'ham))) - (when (spam-group-ham-processor-copy-p gnus-newsgroup-name) - (gnus-message 6 "Copying ham") - (spam-ham-copy-routine - (gnus-parameter-ham-process-destination gnus-newsgroup-name))) - - ;; now move all ham articles out of spam groups - (when (spam-group-spam-contents-p gnus-newsgroup-name) - (gnus-message 6 "Moving ham messages from spam group") - (spam-ham-move-routine - (gnus-parameter-ham-process-destination gnus-newsgroup-name))))) + (when (spam-group-ham-processor-copy-p gnus-newsgroup-name) + (let ((num + (spam-ham-copy-routine + (gnus-parameter-ham-process-destination gnus-newsgroup-name)))) + (when (> num 0) + (gnus-message 6 "%d ham messages are copied" num)))) + + ;; now move all ham articles out of spam groups + (when (spam-group-spam-contents-p gnus-newsgroup-name) + (let ((num + (spam-ham-move-routine + (gnus-parameter-ham-process-destination gnus-newsgroup-name)))) + (when (> num 0) + (gnus-message 6 "%d ham messages are moved from spam group" num))))) (setq spam-old-ham-articles nil) (setq spam-old-spam-articles nil)) @@ -973,7 +973,8 @@ (let ((gnus-novice-user nil)) ; don't ask me if I'm sure (gnus-summary-delete-article nil)))) - (gnus-summary-yank-process-mark)))) + (gnus-summary-yank-process-mark) + (length tomove)))) (defun spam-ham-copy-or-move-routine (copy groups) (gnus-summary-kill-process-mark) @@ -1017,9 +1018,10 @@ (gnus-summary-set-process-mark article)) (when todo (let ((gnus-novice-user nil)) ; don't ask me if I'm sure - (gnus-summary-delete-article nil)))))) + (gnus-summary-delete-article nil))))) - (gnus-summary-yank-process-mark)) + (gnus-summary-yank-process-mark) + (length todo))) (defun spam-ham-copy-routine (&rest groups) (if (and (car-safe groups) (listp (car-safe groups))) --=-=-=--