GNU bug report logs - #61539
29.0.60; When nnselect-always-regenerate, group info gets out-of-date

Previous Next

Package: emacs;

Reported by: Sean Whitton <spwhitton <at> spwhitton.name>

Date: Wed, 15 Feb 2023 19:48:02 UTC

Severity: normal

Found in version 29.0.60

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 61539 <at> debbugs.gnu.org (full text, mbox):

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: 61539 <at> debbugs.gnu.org
Cc: cohen <at> bu.edu
Subject: Re: 29.0.60; When nnselect-always-regenerate, group info gets
 out-of-date
Date: Sat, 18 Feb 2023 13:20:25 -0700
control: tag -1 + patch

Hello,

On Wed 15 Feb 2023 at 12:47PM -07, Sean Whitton wrote:

> 1. Same setup described in #56592, but additionally set
>    nnselect-always-regenerate to t for the groups.
> 2. Enter group.  Mark an unread article as read.
>
>    (length gnus-newsgroup-selection) => 935
>    (car (last (gnus-info-read (gnus-get-info gnus-newsgroup-name))))
>        => (930 . 935)
>
> 3. Exit group.  Enter group again.
>
>    (length gnus-newsgroup-selection) => 934
>    (car (last (gnus-info-read (gnus-get-info gnus-newsgroup-name))))
>        => (930 . 935)
>
> 4. Attempt to exit group again.  Then, while binding select-reads at the
>    beginning of nnselect-push-info, nnselect-categorize signals
>    args-out-of-range, because one of the inline functions it calls
>    attempts to read the 935th element of gnus-newsgroup-selection.

Andrew Cohen sent me the following fix.  I've asked him whether he
thinks this is safe enough for emacs-29.

-- >8 --
From: Andrew Cohen <cohen <at> bu.edu>

diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el
index 87cb1275313..516433aba93 100644
--- a/lisp/gnus/nnselect.el
+++ b/lisp/gnus/nnselect.el
@@ -350,9 +350,9 @@ nnselect-request-group
     ;; the result.
     (unless nnselect-artlist
       (nnselect-store-artlist group
-       (setq nnselect-artlist (nnselect-generate-artlist group)))
+       (setq nnselect-artlist (nnselect-generate-artlist group))))
       (nnselect-request-update-info
-       group (or info (gnus-get-info group))))
+       group (or info (gnus-get-info group)))
     (if (zerop (setq length (nnselect-artlist-length nnselect-artlist)))
 	(progn
 	  (nnheader-report 'nnselect "Selection produced empty results.")
@@ -880,11 +880,13 @@ nnselect-search-thread
 
 
 
-(defun nnselect-push-info (group)
+(defun nnselect-push-info (_group)
   "Copy mark-lists from GROUP to the originating groups."
   (let ((select-unreads (numbers-by-group gnus-newsgroup-unreads))
 	(select-reads (numbers-by-group
-		       (gnus-info-read (gnus-get-info group)) 'range))
+                       (gnus-sorted-difference gnus-newsgroup-articles
+					       gnus-newsgroup-unreads)
+                       'range))
 	(select-unseen (numbers-by-group gnus-newsgroup-unseen))
 	(gnus-newsgroup-active nil) mark-list)
     ;; collect the set of marked article lists categorized by

-- 
Sean Whitton




This bug report was last modified 1 year and 261 days ago.

Previous Next


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