unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34987: 27.0.50; Error after toggling duplicate suppression
@ 2019-03-25  3:45 Basil L. Contovounesios
  2019-03-25  3:54 ` Basil L. Contovounesios
  0 siblings, 1 reply; 5+ messages in thread
From: Basil L. Contovounesios @ 2019-03-25  3:45 UTC (permalink / raw)
  To: 34987; +Cc: Eric Abrahamsen


Further to the discussion in bug#34973 and bug#34974, it indeed looks to
me like gnus-suppress-duplicates cannot be enabled only after entering
the summary buffer.  In other words, I see the following:

0. Start Gnus with gnus-suppress-duplicates left at default value of nil
1. Enter summary buffer
2. M-x set-variable RET gnus-suppress-duplicates RET t RET
3. M-u

Debugger entered--Lisp error: (wrong-type-argument hash-table-p nil)
  remhash("<redacted-message-id>" nil)
  gnus-dup-unsuppress-article(36322)
  gnus-mark-article-as-unread(36322 32)
  gnus-summary-mark-article(nil 32 nil)
  gnus-summary-mark-forward(1 32)
  gnus-summary-clear-mark-forward(1)
  funcall-interactively(gnus-summary-clear-mark-forward 1)
  call-interactively(gnus-summary-clear-mark-forward nil nil)
  command-execute(gnus-summary-clear-mark-forward)

Patch to follow.

Thanks,

-- 
Basil

Gnus v5.13
In GNU Emacs 27.0.50 (build 6, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2019-03-25 built on thunk
Repository revision: 5fdf4fc07df7dd897931efb5dbf5f26dfaff9274
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Debian GNU/Linux buster/sid





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#34987: 27.0.50; Error after toggling duplicate suppression
  2019-03-25  3:45 bug#34987: 27.0.50; Error after toggling duplicate suppression Basil L. Contovounesios
@ 2019-03-25  3:54 ` Basil L. Contovounesios
  2019-04-05 17:43   ` Basil L. Contovounesios
  0 siblings, 1 reply; 5+ messages in thread
From: Basil L. Contovounesios @ 2019-03-25  3:54 UTC (permalink / raw)
  To: 34987; +Cc: Eric Abrahamsen

[-- Attachment #1: Type: text/plain, Size: 109 bytes --]

tags 34987 patch
quit

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> Patch to follow.

Here it is:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-Gnus-duplicate-suppression-guards-bug-34987.patch --]
[-- Type: text/x-diff, Size: 1900 bytes --]

From 162c8d12a4614776e0104b6701d27f5b30bf607b Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@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


[-- Attachment #3: Type: text/plain, Size: 20 bytes --]


Thanks,

-- 
Basil

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#34987: 27.0.50; Error after toggling duplicate suppression
  2019-03-25  3:54 ` Basil L. Contovounesios
@ 2019-04-05 17:43   ` Basil L. Contovounesios
  2019-04-09 19:22     ` Eric Abrahamsen
  0 siblings, 1 reply; 5+ messages in thread
From: Basil L. Contovounesios @ 2019-04-05 17:43 UTC (permalink / raw)
  To: 34987; +Cc: Eric Abrahamsen, Katsumi Yamaoka

[CCing Yamaoka-san due to recent work in this area.]

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
>
>> Patch to follow.
>
> Here it is:
>
> From 162c8d12a4614776e0104b6701d27f5b30bf607b Mon Sep 17 00:00:00 2001
> From: "Basil L. Contovounesios" <contovob@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?

Thanks,

-- 
Basil





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#34987: 27.0.50; Error after toggling duplicate suppression
  2019-04-05 17:43   ` Basil L. Contovounesios
@ 2019-04-09 19:22     ` Eric Abrahamsen
  2019-04-09 20:30       ` Basil L. Contovounesios
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Abrahamsen @ 2019-04-09 19:22 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: Katsumi Yamaoka, 34987

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#34987: 27.0.50; Error after toggling duplicate suppression
  2019-04-09 19:22     ` Eric Abrahamsen
@ 2019-04-09 20:30       ` Basil L. Contovounesios
  0 siblings, 0 replies; 5+ messages in thread
From: Basil L. Contovounesios @ 2019-04-09 20:30 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: Katsumi Yamaoka, 34987-done

tags 34987 fixed
close 34987
quit

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
>
>> Sorry to nag, but I think this is a straightforward enough fix that I
>> would like to push soon.  WDYT?
>
> Looks fine to me...

That's all I need. ;)

Pushed to master[1] and am thus closing this bug.

[1: 6cb49922e6]: Fix Gnus duplicate suppression guards (bug#34987)
  2019-04-09 21:29:38 +0100
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=6cb49922e63c2523ccdd6e0a6bd72bcfa72c50c6

Thanks,

-- 
Basil





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-04-09 20:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-25  3:45 bug#34987: 27.0.50; Error after toggling duplicate suppression Basil L. Contovounesios
2019-03-25  3:54 ` Basil L. Contovounesios
2019-04-05 17:43   ` Basil L. Contovounesios
2019-04-09 19:22     ` Eric Abrahamsen
2019-04-09 20:30       ` Basil L. Contovounesios

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).