diff lisp/gnus/gnus-start.el @ 110194:1acd79f80f50

gnus-start.el (gnus-make-hashtable-from-newsrc-alist): Remove duplicates from .newsrc list.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Sun, 05 Sep 2010 00:56:31 +0000
parents 045086ad722e
children 48695a2e29d9
line wrap: on
line diff
--- a/lisp/gnus/gnus-start.el	Sun Sep 05 00:52:55 2010 +0000
+++ b/lisp/gnus/gnus-start.el	Sun Sep 05 00:56:31 2010 +0000
@@ -1815,14 +1815,18 @@
 	(if (setq rest (member method methods))
 	    (gnus-info-set-method info (car rest))
 	  (push method methods)))
-      (gnus-sethash
-       (car info)
-       ;; Preserve number of unread articles in groups.
-       (cons (and ohashtb (car (gnus-gethash (car info) ohashtb)))
-	     prev)
-       gnus-newsrc-hashtb)
-      (setq prev alist
-	    alist (cdr alist)))
+      ;; Check for duplicates.
+      (if (gnus-gethash (car info) gnus-newsrc-hashtb)
+	  ;; Remove this entry from the alist.
+	  (setcdr prev (cddr prev))
+	(gnus-sethash
+	 (car info)
+	 ;; Preserve number of unread articles in groups.
+	 (cons (and ohashtb (car (gnus-gethash (car info) ohashtb)))
+	       prev)
+	 gnus-newsrc-hashtb)
+	(setq prev alist))
+      (setq alist (cdr alist)))
     ;; Make the same select-methods in `gnus-server-alist' identical
     ;; as well.
     (while methods