Synch to Oort Gnus.
authoryamaoka <yamaoka>
Tue, 11 Feb 2003 22:22:02 +0000 (22:22 +0000)
committeryamaoka <yamaoka>
Tue, 11 Feb 2003 22:22:02 +0000 (22:22 +0000)
lisp/ChangeLog
lisp/gnus-agent.el
lisp/spam.el

index 72aa5c8..6b4e7dc 100644 (file)
@@ -1,3 +1,17 @@
+2002-02-11  Kevin Greiner  <kgreiner@xpediantsolutions.com>
+
+       * gnus-agent.el (gnus-summary-set-agent-mark): Added call to
+       gnus-summary-goto-subject as gnus-summary-update-mark operates on
+       the current LINE.
+       (gnus-agent-summary-fetch-group): Minimized the number of times
+       that the article is updated in the buffer.
+       
+2003-02-11  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-ham-move-routine): use the process-mark instead of
+       gnus-current-article when moving articles
+       (spam-mark-spam-as-expired-and-move-routine): ditto, use the process-mark
+
 2003-02-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
        * gnus-topic.el (gnus-topic-expire-articles): Recursive.
index 5f5ad61..e6060fd 100644 (file)
@@ -66,8 +66,7 @@
 (defcustom gnus-agent-expire-days 7
   "Read articles older than this will be expired.
 This can also be a list of regexp/day pairs.  The regexps will be
-matched against group names.  If nil, articles in the agent cache are
-never expired."
+matched against group names."
   :group 'gnus-agent
   :type '(choice (number :tag "days")
                 (sexp :tag "List" nil)))
@@ -749,18 +748,19 @@ article's mark is toggled."
                       t)
                      (t
                       (memq article gnus-newsgroup-downloadable)))))
-    (gnus-summary-update-mark
-    (if unmark
-        (progn
-         (setq gnus-newsgroup-downloadable
-               (delq article gnus-newsgroup-downloadable))
-          (gnus-article-mark article))
-       (progn
-      (setq gnus-newsgroup-downloadable
-              (gnus-add-to-sorted-list gnus-newsgroup-downloadable article))
-        gnus-downloadable-mark)
-       )
-     'unread)))
+    (when (gnus-summary-goto-subject article nil t)
+      (gnus-summary-update-mark
+       (if unmark
+           (progn
+             (setq gnus-newsgroup-downloadable
+                   (delq article gnus-newsgroup-downloadable))
+             (gnus-article-mark article))
+         (progn
+           (setq gnus-newsgroup-downloadable
+                 (gnus-add-to-sorted-list gnus-newsgroup-downloadable article))
+           gnus-downloadable-mark)
+         )
+       'unread))))
 
 (defun gnus-agent-get-undownloaded-list ()
   "Construct list of articles that have not been downloaded."
@@ -868,14 +868,30 @@ Optional arg ALL, if non-nil, means to fetch all articles."
                         (gnus-agent-fetch-articles
                          gnus-newsgroup-name articles)))))
          (save-excursion
-
             (dolist (article articles)
-             (setq gnus-newsgroup-downloadable
-                   (delq article gnus-newsgroup-downloadable))
-              (if gnus-agent-mark-unread-after-downloaded
-                  (gnus-summary-mark-article article gnus-unread-mark))
-              (when (gnus-summary-goto-subject article nil t)
-                (gnus-summary-update-download-mark article)))))
+              (let ((was-marked-downloadable
+                     (memq article gnus-newsgroup-downloadable)))
+                (when
+                    (cond
+                     (gnus-agent-mark-unread-after-downloaded
+                      (setq gnus-newsgroup-downloadable
+                            (delq article gnus-newsgroup-downloadable))
+
+                      ;; The downloadable mark is implemented as a
+                      ;; type of read mark.  Therefore, marking the
+                      ;; article as unread is sufficient to clear
+                      ;; its downloadable flag.
+                      (gnus-summary-mark-article article gnus-unread-mark)
+                      ;; I just redrew the entire article so
+                      ;; there's no need to update the download
+                      ;; mark below.
+                      nil)
+                     (was-marked-downloadable
+                      (gnus-summary-set-agent-mark article t)
+                      t)
+                     (t t))
+                  (when (gnus-summary-goto-subject article nil t)
+                    (gnus-summary-update-download-mark article)))))))
       (when (and (not state)
                 gnus-plugged)
        (gnus-agent-toggle-plugged nil)))
index 9050c3a..22c9dd4 100644 (file)
@@ -418,8 +418,8 @@ your main source of newsgroup names."
       (when (eq (gnus-summary-article-mark article) gnus-spam-mark)
        (gnus-summary-mark-article article gnus-expirable-mark)
        (when (stringp group)
-         (let ((gnus-current-article article))
-           (gnus-summary-move-article nil group)))))))
+         (gnus-summary-set-process-mark article)
+         (gnus-summary-move-article nil group))))))
  
 (defun spam-ham-move-routine (&optional group)
   (let ((articles gnus-newsgroup-articles)
@@ -427,12 +427,11 @@ your main source of newsgroup names."
 
     (dolist (mark spam-ham-marks)
       (push (symbol-value mark) ham-mark-values))
-    
-    (dolist (article articles)
+    (dolist (article articles)      
       (when (and (memq (gnus-summary-article-mark article) ham-mark-values)
                 (stringp group))
-       (let ((gnus-current-article article))
-         (gnus-summary-move-article nil group))))))
+       (gnus-summary-set-process-mark article)
+       (gnus-summary-move-article nil group)))))
  
 (defun spam-generic-register-routine (spam-func ham-func)
   (let ((articles gnus-newsgroup-articles)