* spam.el (spam-summary-prepare-exit): simplified logic
authorTeodor Zlatanov <tzz@lifelogs.com>
Fri, 16 Apr 2004 18:50:41 +0000 (18:50 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Fri, 16 Apr 2004 18:50:41 +0000 (18:50 +0000)
(spam-fetch-article-header): read the article header if it's not
available
(spam-list-articles): simplified logic
(spam-filelist-register-routine): found bug with unregister-list

* gnus-registry.el: clarified comments at beginning

lisp/ChangeLog
lisp/gnus-registry.el
lisp/spam.el

index daba24d..527e788 100644 (file)
@@ -1,3 +1,13 @@
+2004-04-16  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-summary-prepare-exit): simplified logic
+       (spam-fetch-article-header): read the article header if it's not
+       available
+       (spam-list-articles): simplified logic
+       (spam-filelist-register-routine): found bug with unregister-list
+
+       * gnus-registry.el: clarified comments at beginning
+
 2004-04-16  Jesper Harder  <harder@ifa.au.dk>
 
        * message.el (message-cater-to-broken-inn): Remove.
index 3fa2c88..bce7729 100644 (file)
 
 ;;; Commentary:
 
-;; This is the gnus-registry.el package, works with other backends
-;; besides nnmail.  The major issue is that it doesn't go across
-;; backends, so for instance if an article is in nnml:sys and you see
-;; a reference to it in nnimap splitting, the article will end up in
-;; nnimap:sys
+;; This is the gnus-registry.el package, which works with all
+;; backends, not just nnmail (e.g. NNTP).  The major issue is that it
+;; doesn't go across backends, so for instance if an article is in
+;; nnml:sys and you see a reference to it in nnimap splitting, the
+;; article will end up in nnimap:sys
 
 ;; gnus-registry.el intercepts article respooling, moving, deleting,
 ;; and copying for all backends.  If it doesn't work correctly for
index 0ae3d72..111f671 100644 (file)
@@ -744,10 +744,8 @@ Respects the process/prefix convention."
                   (spam-group-processor-p gnus-newsgroup-name processor))
          (spam-register-routine classification check))))
 
-    (if spam-move-spam-nonspam-groups-only
-       (when (not (spam-group-spam-contents-p gnus-newsgroup-name))
-         (spam-mark-spam-as-expired-and-move-routine
-          (gnus-parameter-spam-process-destination gnus-newsgroup-name)))
+    (unless (and spam-move-spam-nonspam-groups-only
+                (not (spam-group-spam-contents-p gnus-newsgroup-name)))
       (gnus-message 5 "Marking spam as expired and moving it to %s"
                    gnus-newsgroup-name)
       (spam-mark-spam-as-expired-and-move-routine
@@ -985,6 +983,7 @@ When either list is nil, the other is returned."
 (defun spam-fetch-article-header (article)
   (save-excursion
     (set-buffer gnus-summary-buffer)
+    (gnus-read-header article)
     (nth 3 (assq article gnus-newsgroup-data))))
 
 \f
@@ -1245,21 +1244,19 @@ functions")
   (let ((mark-check (if (eq classification 'spam)
                        'spam-group-spam-mark-p
                      'spam-group-ham-mark-p))
-       list mark-cache-yes mark-cache-no)
+       alist mark-cache-yes mark-cache-no)
     (dolist (article articles)
       (let ((mark (gnus-summary-article-mark article)))
-       (unless (memq mark mark-cache-no)
-         (if (memq mark mark-cache-yes)
-             (push article list)
-           ;; else, we have to actually check the mark
-           (if (funcall mark-check
-                        gnus-newsgroup-name
-                        mark)
-               (progn
-                 (push article list)
-                 (push mark mark-cache-yes))
-             (push mark mark-cache-no))))))
-    list))
+       (unless (or (memq mark mark-cache-yes)
+                   (memq mark mark-cache-no))
+         (if (funcall mark-check
+                      gnus-newsgroup-name
+                      mark)
+             (push mark mark-cache-yes)
+           (push mark mark-cache-no)))
+       (when (memq mark mark-cache-yes)
+         (push article alist))))
+    alist))
 
 (defun spam-register-routine (classification
                              check
@@ -1876,7 +1873,7 @@ REMOVE not nil, remove the ADDRESSES."
         (if blacklist 'spam-enter-blacklist 'spam-enter-whitelist))
        (remove-function
         (if blacklist 'spam-enter-whitelist 'spam-enter-blacklist))
-       from addresses unregister-list)
+       from addresses unregister-list article-unregister-list)
     (dolist (article articles)
       (let ((from (spam-fetch-field-from-fast article))
            (id (spam-fetch-field-message-id-fast article))
@@ -1892,6 +1889,7 @@ REMOVE not nil, remove the ADDRESSES."
                 (null unregister)
                 (spam-log-unregistration-needed-p
                  id 'process declassification de-symbol))
+           (push article article-unregister-list)
            (push from unregister-list))
          (unless sender-ignored
            (push from addresses)))))
@@ -1900,7 +1898,7 @@ REMOVE not nil, remove the ADDRESSES."
        (funcall enter-function addresses t) ; unregister all these addresses
       ;; else, register normally and unregister what we need to
       (funcall remove-function unregister-list t)
-      (dolist (article unregister-list)
+      (dolist (article article-unregister-list)
        (spam-log-undo-registration
         (spam-fetch-field-message-id-fast article)
         'process