From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: dick Newsgroups: gmane.emacs.bugs Subject: bug#37590: 27.0.50; gnus-group-set-info setcdr exception Date: Wed, 02 Oct 2019 15:10:54 -0400 Message-ID: <871rvvhsjl.fsf@dick> References: <874l0rhsse.fsf@dick> Mime-Version: 1.0 Content-Type: text/x-diff Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="29986"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: 37590@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 02 21:12:26 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iFk2z-0007eb-Qi for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Oct 2019 21:12:25 +0200 Original-Received: from localhost ([::1]:58690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFk2y-0001yr-O0 for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Oct 2019 15:12:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53600) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iFk2e-0001iV-Iu for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 15:12:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iFk2d-0008GN-Ib for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 15:12:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57761) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iFk2d-0008GH-D9 for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 15:12:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iFk2d-00005k-5h for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2019 15:12:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: dick Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Oct 2019 19:12:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37590 X-GNU-PR-Package: emacs Original-Received: via spool by 37590-submit@debbugs.gnu.org id=B37590.157004346332680 (code B ref 37590); Wed, 02 Oct 2019 19:12:03 +0000 Original-Received: (at 37590) by debbugs.gnu.org; 2 Oct 2019 19:11:03 +0000 Original-Received: from localhost ([127.0.0.1]:38342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFk1f-0008V2-7d for submit@debbugs.gnu.org; Wed, 02 Oct 2019 15:11:03 -0400 Original-Received: from mail-qk1-f173.google.com ([209.85.222.173]:39796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iFk1d-0008UO-M7 for 37590@debbugs.gnu.org; Wed, 02 Oct 2019 15:11:02 -0400 Original-Received: by mail-qk1-f173.google.com with SMTP id 4so16161612qki.6 for <37590@debbugs.gnu.org>; Wed, 02 Oct 2019 12:11:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-disposition:content-description; bh=VDc1dwBRh8G7160ZRLjDZUYQ750+B5xmSrpihVuajuc=; b=sqECzPvCUHIgX1knZRRbXXw/YhpT4wIpo3eDwteMCNTeQioL42cjmhVfUWQqN0GEPb LieSB4yPc/obTkML7BES9/4Ggc0Vimjr3aKpprVP99ATkZWd8dRMQWRMhoJA9uL+KpXN adJJQ1uN8w+Wh0QZHtSNte5xVI/jyyBHu7Irr9r9ZFuOm4oxkdQRe2B22NEmqIvR5aeM dJqcuiwvSOgPSsCeaCs4iV9YjKXBNvsh91wRJYP2Ln8qNfrbCsbmlZYHsUkP4XZRXkyh FBVA5ncOExbJ3pvahWDAqpNJzU2mKJ6p4v6OYtj90ARIRpgq5HJgxJnV1r09YPVc9RxK ocIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-disposition :content-description; bh=VDc1dwBRh8G7160ZRLjDZUYQ750+B5xmSrpihVuajuc=; b=c5BBNrQ5wdsAmKnPXANwCBhcqoLSBRtPbC1Yc0lfz3IlAzFh/acn/gRnoKzNhp9n9S zWtDBhmx/NkrzePcKym/AZk4PaToZdX8i1vQlLAl2KkKcZD9Rc7yxjAFmC6KvDegd2Fd fXR6zcZNxAKYpLAF3v/aLDuZpCqNGMKeWklg2jNzG526/n2m6pjKU0OmtOcxTTg1AfDg yvLoZYtlZUSfITe04RQsQP/DdOEfVqWmjDs4KvlDg7wBgG1NBAUa+GeWpnDoLr9E2qet 8pCflYvlEK44ug+eVN7i3EIQ7t42u2lOj6uo6vdVYE0YB4o9D6GAXHbke1ashXVByEPh m95Q== X-Gm-Message-State: APjAAAVpzKSpKhPTvnHep0h/oSDkScIld36SMjJa4liya1rCsfwVS3/o 3xOf9BKx945aSffEqu7kaZX5DsVM X-Google-Smtp-Source: APXvYqzebiQxLeOnNKsN9nzKpv/IjnKLPvpgHQgM+LucxZSMmbxJ17w1r8fHsvL/SIxCmtKWcOj17Q== X-Received: by 2002:a37:5887:: with SMTP id m129mr344863qkb.27.1570043455981; Wed, 02 Oct 2019 12:10:55 -0700 (PDT) Original-Received: from localhost (pool-100-33-98-8.nycmny.fios.verizon.net. [100.33.98.8]) by smtp.gmail.com with ESMTPSA id w11sm190704qtj.10.2019.10.02.12.10.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 12:10:55 -0700 (PDT) In-Reply-To: <874l0rhsse.fsf@dick> (dick's message of "Wed, 02 Oct 2019 15:05:37 -0400") Content-Disposition: inline; filename=0001-Avoid-setcdr-exception-when-gnus-newsrc-alist-is-emp.patch Content-Description: patch X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:168173 Archived-At: >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