Gnus development mailing list
 help / color / mirror / Atom feed
* [spam.el] Misleading messages on group exit
@ 2004-05-06 12:08 Reiner Steib
  2004-05-11  6:37 ` TSUCHIYA Masatoshi
  0 siblings, 1 reply; 10+ messages in thread
From: Reiner Steib @ 2004-05-06 12:08 UTC (permalink / raw)


Hi,

when I quit the summary buffer in a ham group, I get the message
"Marking spam as expired without moving it" although I marked an
article as spam that should have been moved.  In fact, the article was
moved, i.e. the message is misleading or wrong.

Relevant group parameters:

   ("nnml.*:misc\.inbox"
    (spam-process-destination . "nnml+personal:misc.Spam")
    (spam-contents gnus-group-spam-classification-ham))
   ("nnimap.*:\\(INBOX\\|...\\)"
    (spam-process-destination "nnimap+urz:bayes/spam"
			      "nnimap+urz:Spam/spamblock")
    (spam-contents gnus-group-spam-classification-ham))

Relevant parts of *Messages* buffer:

,----
| Retrieving newsgroup: nnml+personal:misc.inbox...
| Fetching headers for nnml+personal:misc.inbox...done
| Sorting articles...done
| Generating summary...done
| No more articles [2 times]
| Exiting summary buffer and applying spam rules
| Marking spam as expired and moving it to nnml+personal:misc.Spam
| Moving to nnml+personal:misc.Spam: (90)...
| Loading gnus-dup...done
| Wrote /home/dept/ste/Mail/personal/misc.Spam/597
| Marking spam as expired without moving it
`----

,----
| Exiting summary buffer and applying spam rules
| Marking spam as expired and moving it to (nnimap+urz:bayes/spam
|  nnimap+urz:Spam/spamblock)
| Copying to nnimap+urz:bayes/spam: (7596)...
| nnimap: Setting marks in bayes/spam...done
| nnimap: Updating info for nnimap+urz:bayes/spam...done
| Copying to nnimap+urz:Spam/spamblock: (7596)...
| nnimap: Setting marks in Spam/spamblock...done
| nnimap: Updating info for nnimap+urz:Spam/spamblock...done
| Marking spam as expired without moving it
| Expiring articles...done
| nnimap: Setting marks in INBOX...done
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [spam.el] Misleading messages on group exit
  2004-05-06 12:08 [spam.el] Misleading messages on group exit Reiner Steib
@ 2004-05-11  6:37 ` TSUCHIYA Masatoshi
  2004-05-12  5:09   ` TSUCHIYA Masatoshi
  0 siblings, 1 reply; 10+ messages in thread
From: TSUCHIYA Masatoshi @ 2004-05-11  6:37 UTC (permalink / raw)


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

>> On Thu, 06 May 2004 14:08:35 +0200
>> 4.uce.03.r.s@nurfuerspam.de (Reiner Steib) said as follows:

>when I quit the summary buffer in a ham group, I get the message
>"Marking spam as expired without moving it" although I marked an
>article as spam that should have been moved.  In fact, the article
>was moved, i.e. the message is misleading or wrong.

I think that this message is misleading, too.  Therefore, I'd like to
propose the attached change that makes spam.el quiet slightly.

Any comments?

-- 
TSUCHIYA Masatoshi

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

--- spam.el	30 Apr 2004 17:55:59 -0000	7.34
+++ spam.el	11 May 2004 06:31:30 -0000
@@ -861,16 +861,20 @@
 
     (unless (and spam-move-spam-nonspam-groups-only
 		 (spam-group-spam-contents-p gnus-newsgroup-name))
-      (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 ((num
+	     (spam-mark-spam-as-expired-and-move-routine
+	      (gnus-parameter-spam-process-destination gnus-newsgroup-name))))
+	(when (> num 0)
+	  (gnus-message 6 "Marking %d spams as expired and moving it to %s"
+			num (gnus-parameter-spam-process-destination
+			     gnus-newsgroup-name)))))
 
     ;; now we redo spam-mark-spam-as-expired-and-move-routine to only
     ;; expire spam, in case the above did not expire them
-    (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 "Marking %d spams 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)
@@ -964,7 +968,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)
@@ -1406,12 +1411,13 @@
 			    gnus-newsgroup-articles
 			    classification)))
 	;; process them
-	(gnus-message 5 "%s %d %s articles as %s using backend %s"
-		      (if unregister "Unregistering" "Registering")
-		      (length articles)
-		      (if specific-articles "specific" "")
-		      (symbol-name classification)
-		      (symbol-name check))
+	(when articles
+	  (gnus-message 5 "%s %d%s articles as %s using backend %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)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [spam.el] Misleading messages on group exit
  2004-05-11  6:37 ` TSUCHIYA Masatoshi
@ 2004-05-12  5:09   ` TSUCHIYA Masatoshi
  2004-05-14 19:23     ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: TSUCHIYA Masatoshi @ 2004-05-12  5:09 UTC (permalink / raw)


>> On Tue, 11 May 2004 06:37:02 +0000
>> tsuchiya@namazu.org (TSUCHIYA Masatoshi) said as follows:

>I think that this message is misleading, too.

I still think that this message is misleading.

>Therefore, I'd like to propose the attached change that makes spam.el
>quiet slightly.

However, I have noticed that my poposed change makes messages of
spam.el inconsistent, and that it is not sufficient to resolve this
problem.  I, therefore, withdraw my proposal.

-- 
TSUCHIYA Masatoshi



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [spam.el] Misleading messages on group exit
  2004-05-12  5:09   ` TSUCHIYA Masatoshi
@ 2004-05-14 19:23     ` Ted Zlatanov
  2004-05-16 15:56       ` TSUCHIYA Masatoshi
  0 siblings, 1 reply; 10+ messages in thread
From: Ted Zlatanov @ 2004-05-14 19:23 UTC (permalink / raw)


On Wed, 12 May 2004, tsuchiya@namazu.org wrote:

>>> On Tue, 11 May 2004 06:37:02 +0000
>>> tsuchiya@namazu.org (TSUCHIYA Masatoshi) said as follows:
> 
>>I think that this message is misleading, too.
> 
> I still think that this message is misleading.

I think a fix I just comitted will fix this message, producing it
only when there's spam in the group.  Let me know if so.

Ted



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [spam.el] Misleading messages on group exit
  2004-05-14 19:23     ` Ted Zlatanov
@ 2004-05-16 15:56       ` TSUCHIYA Masatoshi
  2004-05-17 14:12         ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: TSUCHIYA Masatoshi @ 2004-05-16 15:56 UTC (permalink / raw)


>> On 14 May 2004 15:23:44 -0400
>> tzz@lifelogs.com ("Ted Zlatanov") said as follows:

> I think a fix I just comitted will fix this message, producing it
> only when there's spam in the group.

Your fix is as insufficient as my proposal, I think.

I noticed that spam-summary-prepare-exit() has three misleading
messages at least.  The first one is "Marking spam as expired and
moving it to nnml:spam" at line 864, which is printed even if there is
no spam article in the current group.  The second one is "Copying ham"
at line 892, which is printed even if there is no ham article in the
current group.  And, the last one is "Moving ham messages from spam
group" at line 898, which is printed even if there is no ham article
that should be moved from spam group.

-- 
TSUCHIYA Masatoshi



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [spam.el] Misleading messages on group exit
  2004-05-16 15:56       ` TSUCHIYA Masatoshi
@ 2004-05-17 14:12         ` Ted Zlatanov
  2004-05-20  2:29           ` TSUCHIYA Masatoshi
  0 siblings, 1 reply; 10+ messages in thread
From: Ted Zlatanov @ 2004-05-17 14:12 UTC (permalink / raw)


On Mon, 17 May 2004, tsuchiya@namazu.org wrote:

>>> On 14 May 2004 15:23:44 -0400
>>> tzz@lifelogs.com ("Ted Zlatanov") said as follows:
> 
>> I think a fix I just comitted will fix this message, producing it
>> only when there's spam in the group.
> 
> Your fix is as insufficient as my proposal, I think.

Can you be specific as to why?  The logic seems OK to me.  Note I
generate the list of spam articles when the message is about to be
generated, not earlier.  I can put the actual numbers in the
message, but right now I'm trying to get the logic correct.

> I noticed that spam-summary-prepare-exit() has three misleading
> messages at least.  The first one is "Marking spam as expired and
> moving it to nnml:spam" at line 864, which is printed even if there
> is no spam article in the current group.  The second one is "Copying
> ham" at line 892, which is printed even if there is no ham article
> in the current group.  And, the last one is "Moving ham messages
> from spam group" at line 898, which is printed even if there is no
> ham article that should be moved from spam group.

I tried to fix those as well.  Fixes in CVS - let me know what you think.

Thanks
Ted



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [spam.el] Misleading messages on group exit
  2004-05-17 14:12         ` Ted Zlatanov
@ 2004-05-20  2:29           ` TSUCHIYA Masatoshi
  2004-05-20 14:23             ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: TSUCHIYA Masatoshi @ 2004-05-20  2:29 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [spam.el] Misleading messages on group exit
  2004-05-20  2:29           ` TSUCHIYA Masatoshi
@ 2004-05-20 14:23             ` Ted Zlatanov
  2004-05-20 16:48               ` TSUCHIYA Masatoshi
  0 siblings, 1 reply; 10+ messages in thread
From: Ted Zlatanov @ 2004-05-20 14:23 UTC (permalink / raw)


On Thu, 20 May 2004, tsuchiya@namazu.org wrote:

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

I'm OK with this, it improves my version nicely.  I didn't see you in
the ChangeLog - do you have papers on file, before I commit your
changes (I assume you can't)?

Thanks
Ted



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [spam.el] Misleading messages on group exit
  2004-05-20 14:23             ` Ted Zlatanov
@ 2004-05-20 16:48               ` TSUCHIYA Masatoshi
  2004-05-20 17:42                 ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: TSUCHIYA Masatoshi @ 2004-05-20 16:48 UTC (permalink / raw)


>> On 20 May 2004 10:23:49 -0400
>> tzz@lifelogs.com ("Ted Zlatanov") said as follows:

>> I'd like to propose the attached change, which simplifies the
>> condition to display status messages.

> I'm OK with this, it improves my version nicely.

I have installed my prposed change to CVS with your approval.

>I didn't see you in the ChangeLog

That's strange.  Could you check lisp/ChangeLog?

By the way, thank you for your kind comments.

-- 
TSUCHIYA Masatoshi



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [spam.el] Misleading messages on group exit
  2004-05-20 16:48               ` TSUCHIYA Masatoshi
@ 2004-05-20 17:42                 ` Ted Zlatanov
  0 siblings, 0 replies; 10+ messages in thread
From: Ted Zlatanov @ 2004-05-20 17:42 UTC (permalink / raw)


On Thu, 20 May 2004, tsuchiya@namazu.org wrote:

> I have installed my prposed change to CVS with your approval.

Thanks!

>>I didn't see you in the ChangeLog
> 
> That's strange.  Could you check lisp/ChangeLog?

Oh, I looked for "Tsuchiya" but your name is listed as "TSUCHIYA."
Sorry, I should have done a case-insensitive search.

Ted



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-05-20 17:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-06 12:08 [spam.el] Misleading messages on group exit 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
2004-05-20 14:23             ` Ted Zlatanov
2004-05-20 16:48               ` TSUCHIYA Masatoshi
2004-05-20 17:42                 ` Ted Zlatanov

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