info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: spam2.el (was: How to unregister message as spam/ham?)


From: Adam Sjøgren
Subject: Re: spam2.el (was: How to unregister message as spam/ham?)
Date: Thu, 10 Sep 2009 19:56:24 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) XEmacs/21.5-b29 (linux)

On Thu, 10 Sep 2009 09:31:31 -0500, Ted wrote:

> Can you prepare a full patch, with a ChangeLog entry?

I don't know the exact conventions for the Changelog, so I just tried to
follow the style of the entries near the top. Patches attached.


  Best regards,

     Adam

-- 
 "My internal clock is on Tokyo time."                        Adam Sjøgren
                                                         asjo@koldfront.dk

 lisp/ChangeLog |    6 ++++++
 lisp/spam.el   |   17 ++++++++++++-----
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 669d50b..a65068e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2009-09-10  Adam Sjøgren  <asjo@koldfront.dk>
+
+       * spam.el (spam-unregister-on-reregister): Add boolearn variable.
+       (spam-resolve-registrations-routine): unregister articles that change
+       status if spam-unregister-on-reregister is true.
+
 2009-09-10  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * imap.el (imap-interactive-login): Better messages.
diff --git a/lisp/spam.el b/lisp/spam.el
index 2d2fafa..e556062 100644
--- a/lisp/spam.el
+++ b/lisp/spam.el
@@ -158,6 +158,12 @@ Normally this is nil, so only unseen messages will be 
checked."
   :type 'boolean
   :group 'spam)
 
+(defcustom spam-unregister-on-reregister nil
+  "Whether to always unregister before reregistering (i.e. to
+unlearn when changing ham to spam or vice versa)."
+  :type 'boolean
+  :group 'spam)
+
 (defcustom spam-whitelist (expand-file-name "whitelist" spam-directory)
   "The location of the whitelist.
 The file format is one regular expression per line.
@@ -1772,11 +1778,12 @@ See the Info node `(gnus)Fancy Mail Splitting' for more 
details."
                                              t)
 
          ;; eliminate duplicates
-         (dolist (article (copy-sequence ulist))
-           (when (memq article rlist)
-             (incf delcount)
-             (setq rlist (delq article rlist))
-             (setq ulist (delq article ulist))))
+          (when (not spam-unregister-on-reregister)
+            (dolist (article (copy-sequence ulist))
+              (when (memq article rlist)
+                (incf delcount)
+                (setq rlist (delq article rlist))
+                (setq ulist (delq article ulist)))))
 
          (unless (zerop delcount)
            (gnus-message
-- 
1.6.3.3

 lisp/ChangeLog |    2 ++
 lisp/spam.el   |   10 ++++------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index a65068e..186a4ee 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,6 +4,8 @@
        (spam-resolve-registrations-routine): unregister articles that change
        status if spam-unregister-on-reregister is true.
 
+       * spam.el: Set switch for unregistering for crm114, and use it.
+
 2009-09-10  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * imap.el (imap-interactive-login): Better messages.
diff --git a/lisp/spam.el b/lisp/spam.el
index e556062..9f925b3 100644
--- a/lisp/spam.el
+++ b/lisp/spam.el
@@ -666,12 +666,12 @@ order for SpamAssassin to recognize the new registered 
spam."
   :type 'string
   :group 'spam-crm114)
 
-(defcustom spam-crm114-spam-strong-switch "--UNKNOWN"
+(defcustom spam-crm114-spam-strong-switch "--unlearn"
   "The switch that CRM114 Mailfilter uses to unregister ham messages."
   :type 'string
   :group 'spam-crm114)
 
-(defcustom spam-crm114-ham-strong-switch "--UNKNOWN"
+(defcustom spam-crm114-ham-strong-switch "--unlearn"
   "The switch that CRM114 Mailfilter uses to unregister spam messages."
   :type 'string
   :group 'spam-crm114)
@@ -1158,10 +1158,8 @@ backends)."
                                  'spam-check-crm114
                                  'spam-crm114-register-ham-routine
                                  'spam-crm114-register-spam-routine
-                                 ;; does CRM114 Mailfilter support 
unregistration?
-                                 nil
-                                 nil)
-
+                                 'spam-crm114-unregister-ham-routine
+                                 'spam-crm114-unregister-spam-routine)
 ;;}}}
 
 ;;{{{ scoring and summary formatting
-- 
1.6.3.3


reply via email to

[Prev in Thread] Current Thread [Next in Thread]