GNU bug report logs - #34987
27.0.50; Error after toggling duplicate suppression

Previous Next

Packages: gnus, emacs;

Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Date: Mon, 25 Mar 2019 03:46:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 5.13

Done: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: Katsumi Yamaoka <yamaoka <at> jpl.org>, 34987 <at> debbugs.gnu.org
Subject: bug#34987: 27.0.50; Error after toggling duplicate suppression
Date: Tue, 09 Apr 2019 12:22:54 -0700
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:

> [CCing Yamaoka-san due to recent work in this area.]
>
> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>
>> "Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
>>
>>> Patch to follow.
>>
>> Here it is:
>>
>> From 162c8d12a4614776e0104b6701d27f5b30bf607b Mon Sep 17 00:00:00 2001
>> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
>> 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...




This bug report was last modified 6 years and 44 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.