From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#34987: 27.0.50; Error after toggling duplicate suppression Date: Tue, 09 Apr 2019 12:22:54 -0700 Message-ID: <877ec3dlv5.fsf@ericabrahamsen.net> References: <87pnqfiply.fsf@tcd.ie> <874l7rip7q.fsf@tcd.ie> <87a7h48i1k.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="140530"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Katsumi Yamaoka , 34987@debbugs.gnu.org To: "Basil L. Contovounesios" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 09 21:24:14 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.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hDwLr-000aOg-N2 for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Apr 2019 21:24:11 +0200 Original-Received: from localhost ([127.0.0.1]:48049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDwLq-0008B2-HQ for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Apr 2019 15:24:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDwLk-0008Ad-GY for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2019 15:24:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDwLj-00053V-BH for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2019 15:24:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38445) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hDwLi-000537-SI for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2019 15:24:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hDwLi-0002MU-Cy; Tue, 09 Apr 2019 15:24:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Tue, 09 Apr 2019 19:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34987 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: patch Original-Received: via spool by 34987-submit@debbugs.gnu.org id=B34987.15548377868999 (code B ref 34987); Tue, 09 Apr 2019 19:24:02 +0000 Original-Received: (at 34987) by debbugs.gnu.org; 9 Apr 2019 19:23:06 +0000 Original-Received: from localhost ([127.0.0.1]:51989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDwKo-0002L5-4j for submit@debbugs.gnu.org; Tue, 09 Apr 2019 15:23:06 -0400 Original-Received: from ericabrahamsen.net ([52.70.2.18]:47584 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDwKj-0002KK-Nd for 34987@debbugs.gnu.org; Tue, 09 Apr 2019 15:23:03 -0400 Original-Received: from localhost (97-113-35-98.tukw.qwest.net [97.113.35.98]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id CDC8FFA05B; Tue, 9 Apr 2019 19:22:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ericabrahamsen.net; s=mail; t=1554837776; bh=98zVDzKzYHdvrA5LiV2AjyghMighrsvucuUlxU+rwV0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=UVnoVd+VzMwLJTllxIQveC0BUJtrWSt5Xs20gVJG34trPBeNB9alj5gC/0Ytn2Pi4 orSNxlxnZElyWRCWgvp1fqCHQFCJp8qmTtdQCcnOdEzjHW2C+kTr6CRTjSoUGzIZ21 ZJzZxKkQNrkxQnSUnVXyETbFfCXG9EKNuGMLWBlY= In-Reply-To: <87a7h48i1k.fsf@tcd.ie> (Basil L. Contovounesios's message of "Fri, 05 Apr 2019 18:43:03 +0100") 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:157430 Archived-At: "Basil L. Contovounesios" writes: > [CCing Yamaoka-san due to recent work in this area.] > > "Basil L. Contovounesios" writes: > >> "Basil L. Contovounesios" writes: >> >>> Patch to follow. >> >> Here it is: >> >> From 162c8d12a4614776e0104b6701d27f5b30bf607b Mon Sep 17 00:00:00 2001 >> From: "Basil L. Contovounesios" >> Date: Mon, 25 Mar 2019 02:15:10 +0000 >> Subject: [PATCH] Fix Gnus duplicate suppression guards (bug#34987) >> >> * lisp/gnus/gnus-dup.el (gnus-dup-enter-articles) >> (gnus-dup-suppress-articles): Use gnus-dup-hashtb as an indicator of >> initialization instead of gnus-dup-list, which may happen to be nil. >> (gnus-dup-unsuppress-article): Do nothing if gnus-dup-hashtb is >> uninitialized. >> --- >> lisp/gnus/gnus-dup.el | 11 ++++++----- >> 1 file changed, 6 insertions(+), 5 deletions(-) >> >> diff --git a/lisp/gnus/gnus-dup.el b/lisp/gnus/gnus-dup.el >> index 8b876489e1..86dbf1a574 100644 >> --- a/lisp/gnus/gnus-dup.el >> +++ b/lisp/gnus/gnus-dup.el >> @@ -105,7 +105,7 @@ gnus-dup-save >> >> (defun gnus-dup-enter-articles () >> "Enter articles from the current group for future duplicate suppression." >> - (unless gnus-dup-list >> + (unless gnus-dup-hashtb >> (gnus-dup-open)) >> (setq gnus-dup-list-dirty t) ; mark list for saving >> (let (msgid) >> @@ -129,7 +129,7 @@ gnus-dup-enter-articles >> >> (defun gnus-dup-suppress-articles () >> "Mark duplicate articles as read." >> - (unless gnus-dup-list >> + (unless gnus-dup-hashtb >> (gnus-dup-open)) >> (gnus-message 8 "Suppressing duplicates...") >> (let ((auto (and gnus-newsgroup-auto-expire >> @@ -149,9 +149,10 @@ gnus-dup-suppress-articles >> >> (defun gnus-dup-unsuppress-article (article) >> "Stop suppression of ARTICLE." >> - (let* ((header (gnus-data-header (gnus-data-find article))) >> - (id (when header (mail-header-id header)))) >> - (when id >> + (let (header id) >> + (when (and gnus-dup-hashtb >> + (setq header (gnus-data-header (gnus-data-find article))) >> + (setq id (mail-header-id header))) >> (setq gnus-dup-list-dirty t) >> (setq gnus-dup-list (delete id gnus-dup-list)) >> (remhash id gnus-dup-hashtb)))) >> -- >> 2.20.1 > > Sorry to nag, but I think this is a straightforward enough fix that I > would like to push soon. WDYT? Looks fine to me...