From 92862ab4d7e9f8400229add13a6e16e437d6dbd3 Mon Sep 17 00:00:00 2001 From: dickmao Date: Wed, 2 Oct 2019 14:22:26 -0400 Subject: [PATCH] Avoid setcdr exception when gnus-newsrc-alist is empty Exception occurs when using debbugs-gnu. * lisp/gnus/gnus-group.el (gnus-group-set-info): check if gnus-newsrc-alist is a consp --- lisp/gnus/gnus-group.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 915125b655..bca5d35f24 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -4466,11 +4466,14 @@ gnus-group-set-info (gnus-list-of-unread-articles (car info))))) ;; The above `setcar' will only affect the hashtable, not ;; the alist: update the alist separately. - (push info (cdr (setq gnus-newsrc-alist - (remove (assoc-string - (gnus-info-group info) - gnus-newsrc-alist) - gnus-newsrc-alist))))) + (setf (alist-get (car info) + ;; avoid usurping dummy info at the head + ;; of gnus-newsrc-alist + (if (consp gnus-newsrc-alist) + (cdr gnus-newsrc-alist) + gnus-newsrc-alist) + nil nil #'equal) + (cdr info))) (error "No such group: %s" (gnus-info-group info)))))) ;; Ad-hoc function for inserting data from a different newsrc.eld -- 2.23.0