From: Lars Magne Ingebrigtsen Date: Sun, 5 Sep 2010 00:56:31 +0000 (+0000) Subject: gnus-start.el (gnus-make-hashtable-from-newsrc-alist): Remove duplicates from .newsrc... X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~48^2~83 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fb994703be0711372966a1a5251b9b345d18f297;p=emacs.git gnus-start.el (gnus-make-hashtable-from-newsrc-alist): Remove duplicates from .newsrc list. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 5f692d626cf..9ed24b72a55 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -2,6 +2,8 @@ * gnus-start.el (gnus-get-unread-articles): Protect against groups that come from no known methods. + (gnus-make-hashtable-from-newsrc-alist): Remove duplicates from .newsrc + list. * pop3.el (pop3-display-message-size-flag): Removed -- everybody wants message sizes. diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index c7d85524ef0..0e35a12cf7d 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el @@ -1815,14 +1815,18 @@ If SCAN, request a scan of that group as well." (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