From af50912dc6aa5e20b3fa9df6ada6668d662a1018 Mon Sep 17 00:00:00 2001 From: Dave Love Date: Tue, 29 Aug 2000 14:55:24 +0000 Subject: [PATCH] (gnus-agent-union): new function. (gnus-agent-fetch-headers): Use it. --- lisp/gnus-agent.el | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index 27442fa69..3a4d4bb81 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -867,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. -- 2.25.1