Disable mutibyte of mail-source-crash-box in the imap case.
[gnus] / lisp / gnus-agent.el
index 5696b68..3a4d4bb 100644 (file)
@@ -28,6 +28,7 @@
 (require 'nnvirtual)
 (require 'gnus-sum)
 (eval-when-compile
+  (require 'timer)
   (require 'cl)
   (require 'gnus-score))
 
@@ -443,7 +444,8 @@ Currently sends flag setting requests, if any."
              (write-file (gnus-agent-lib-file "flags"))
              (error "Couldn't set flags from file %s"
                     (gnus-agent-lib-file "flags"))))
-         (write-file (gnus-agent-lib-file "flags")))))))
+         (write-file (gnus-agent-lib-file "flags")))
+        (kill-buffer nil)))))
 
 ;;;
 ;;; Server mode commands
@@ -865,13 +867,29 @@ the actual number of articles toggled is returned."
        (insert "\n"))
       (pop gnus-agent-group-alist))))
 
+(if (fboundp 'union)
+    (defalias 'gnus-agent-union 'union)
+  (defun gnus-agent-union (l1 l2)
+    "Set union of lists L1 and L2."
+    (cond ((null l1) l2)
+         ((null l2) l1)
+         ((equal l1 l2) l1)
+         (t
+          (or (>= (length l1) (length l2))
+              (setq l1 (prog1 l2 (setq l2 l1))))
+          (while l2
+            (or (memq (car l2) l1)
+                (push (car l2) l1))
+            (pop l2))
+          l1))))
+
 (defun gnus-agent-fetch-headers (group &optional force)
   (let ((articles (gnus-list-of-unread-articles group))
        (gnus-decode-encoded-word-function 'identity)
        (file (gnus-agent-article-name ".overview" group)))
     ;; Add article with marks to list of article headers we want to fetch.
     (dolist (arts (gnus-info-marks (gnus-get-info group)))
-      (setq articles (union (gnus-uncompress-sequence (cdr arts))
+      (setq articles (gnus-agent-union (gnus-uncompress-sequence (cdr arts))
                            articles)))
     (setq articles (sort articles '<))
     ;; Remove known articles.
@@ -1027,7 +1045,13 @@ the actual number of articles toggled is returned."
        gnus-newsgroup-dependencies gnus-newsgroup-headers
        gnus-newsgroup-scored gnus-headers gnus-score
        gnus-use-cache articles arts
-       category predicate info marks score-param)
+       category predicate info marks score-param
+       (gnus-summary-expunge-below gnus-summary-expunge-below)
+       (gnus-summary-mark-below gnus-summary-mark-below)
+       (gnus-orphan-score gnus-orphan-score)
+       ;; Maybe some other gnus-summary local variables should also
+       ;; be put here.
+       )
     (unless (gnus-check-group group)
       (error "Can't open server for %s" group))
     ;; Fetch headers.