Gnus development mailing list
 help / color / mirror / Atom feed
From: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
Subject: Re: [spam.el] Misleading messages on group exit
Date: Thu, 20 May 2004 11:29:47 +0900	[thread overview]
Message-ID: <878yfn4yqs.fsf@pine.kuee.kyoto-u.ac.jp> (raw)
In-Reply-To: <4nu0yfuopr.fsf@lifelogs.com>

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

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

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

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

  reply	other threads:[~2004-05-20  2:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-06 12:08 Reiner Steib
2004-05-11  6:37 ` TSUCHIYA Masatoshi
2004-05-12  5:09   ` TSUCHIYA Masatoshi
2004-05-14 19:23     ` Ted Zlatanov
2004-05-16 15:56       ` TSUCHIYA Masatoshi
2004-05-17 14:12         ` Ted Zlatanov
2004-05-20  2:29           ` TSUCHIYA Masatoshi [this message]
2004-05-20 14:23             ` Ted Zlatanov
2004-05-20 16:48               ` TSUCHIYA Masatoshi
2004-05-20 17:42                 ` Ted Zlatanov

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=878yfn4yqs.fsf@pine.kuee.kyoto-u.ac.jp \
    --to=tsuchiya@namazu.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).