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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61539 in the body.
You can then email your comments to 61539 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to cohen <at> andy.bu.edu, bug-gnu-emacs <at> gnu.org:
bug#61539; Package emacs. (Wed, 15 Feb 2023 19:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sean Whitton <spwhitton <at> spwhitton.name>:
New bug report received and forwarded. Copy sent to cohen <at> andy.bu.edu, bug-gnu-emacs <at> gnu.org. (Wed, 15 Feb 2023 19:48:02 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> spwhitton.name>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.60; When nnselect-always-regenerate, group info gets out-of-date
Date: Wed, 15 Feb 2023 12:47:18 -0700
X-debbugs-cc: cohen <at> andy.bu.edu

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.

I believe that the nnselect-always-regenerate branch of
nnselect-get-artlist needs to update the group info, because the
following hack seems to avoid the problem.

-- >8 --
diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el
index 87cb1275313..fdb4956b8e6 100644
--- a/lisp/gnus/nnselect.el
+++ b/lisp/gnus/nnselect.el
@@ -303,7 +303,10 @@ nnselect-get-artlist
        (cond
         (override (funcall override ,group))
         ((gnus-group-get-parameter ,group 'nnselect-always-regenerate)
-         (nnselect-generate-artlist ,group))
+         (let* ((artlist (nnselect-generate-artlist ,group))
+                (gnus-newsgroup-selection artlist))
+           (nnselect-request-update-info ,group (gnus-get-info ,group))
+           artlist))
         (t
 	 (nnselect-uncompress-artlist
           (gnus-group-get-parameter ,group 'nnselect-artlist t)))))))

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61539; Package emacs. (Sat, 18 Feb 2023 20:21:02 GMT) Full text and rfc822 format available.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61539; Package emacs. (Sun, 12 Mar 2023 07:17:03 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> arizona.edu>
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, 11 Mar 2023 14:18:34 -0700
Hello,

On Sat 18 Feb 2023 at 01:20PM -07, Sean Whitton wrote:

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

Just to update this bug, I've been in touch with Andrew recently and he
has sent some improved versions of the fix (many thanks again), but
there are some residual bugs he's still working out before I can do some
final testing.

The final patch will very likely be too large for Emacs 29.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61539; Package emacs. (Tue, 11 Apr 2023 16:12:01 GMT) Full text and rfc822 format available.

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

From: Sean Whitton <spwhitton <at> arizona.edu>
To: Andrew G Cohen <cohen <at> andy.bu.edu>
Cc: 61539 <at> debbugs.gnu.org
Subject: Re: master 0724e0aeb5b: * lisp/gnus/nnselect.el
 (nnselect-push-info): Sort artlist
Date: Tue, 11 Apr 2023 09:11:47 -0700
Hello,

On Mon 10 Apr 2023 at 11:52PM -04, Andrew G Cohen wrote:

> branch: master
> commit 0724e0aeb5be7c60cd76c6afc8e22ed47d9c85bd
> Author: Andrew G Cohen <cohen <at> andy.bu.edu>
> Commit: Andrew G Cohen <cohen <at> andy.bu.edu>
>
>     * lisp/gnus/nnselect.el (nnselect-push-info): Sort artlist
> ---
>  lisp/gnus/nnselect.el | 1 +
>  1 file changed, 1 insertion(+)

With this change, do you believe #61539 to be resolved?  I ask because
the patch you sent me to test is slightly different to what's now on
master.  I would like to switch to testing master, but only if you've
finished pushing the fix.

I did see an args out of range error, copied below, today, with the
patch you sent off-list, when trying to enter a group.  But it happened
just once, and possibly your subsequent changes fix the problem.

Thanks!

    nnselect-retrieve-headers: Args out of range:
    [["nnmaildir+fmail:annex" 797867 100] ["nnmaildir+fmail:annex"
    798482 100] ["nnmaildir+fmail:annex" 800077 100]
    ["nnmaildir+fmail:annex" 800110 100] ["nnmaildir+fmail:annex" 800209
    100] ["nnmaildir+fmail:annex" 804911 100] ["nnmaildir+fmail:annex"
    805086 100] ["nnmaildir+fmail:annex" 805091 100]
    ["nnmaildir+fmail:annex" 805223 100] ["nnmaildir+fmail:annex" 805262
    100] ...], 6388

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61539; Package emacs. (Mon, 04 Sep 2023 19:47:02 GMT) Full text and rfc822 format available.

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

From: stefankangas <at> gmail.com
To: Sean Whitton <spwhitton <at> arizona.edu>
Cc: cohen <at> bu.edu, 61539 <at> debbugs.gnu.org
Subject: Re: bug#61539: 29.0.60; When nnselect-always-regenerate, group info
 gets out-of-date
Date: Mon, 4 Sep 2023 12:46:04 -0700
Sean Whitton <spwhitton <at> arizona.edu> writes:

> Just to update this bug, I've been in touch with Andrew recently and he
> has sent some improved versions of the fix (many thanks again), but
> there are some residual bugs he's still working out before I can do some
> final testing.
>
> The final patch will very likely be too large for Emacs 29.

Did you make any progress here?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61539; Package emacs. (Mon, 04 Sep 2023 23:22:01 GMT) Full text and rfc822 format available.

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

From: Andrew Cohen <cohen <at> bu.edu>
To: stefankangas <at> gmail.com
Cc: cohen <at> bu.edu, Sean Whitton <spwhitton <at> arizona.edu>, 61539 <at> debbugs.gnu.org
Subject: Re: bug#61539: 29.0.60; When nnselect-always-regenerate, group info
 gets out-of-date
Date: Tue, 05 Sep 2023 07:21:32 +0800
>>>>> "s" == stefankangas  <stefankangas <at> gmail.com> writes:

    s> Sean Whitton <spwhitton <at> arizona.edu> writes:
    >> Just to update this bug, I've been in touch with Andrew recently
    >> and he has sent some improved versions of the fix (many thanks
    >> again), but there are some residual bugs he's still working out
    >> before I can do some final testing.
    >> 
    >> The final patch will very likely be too large for Emacs 29.

    s> Did you make any progress here?

Just forgot to close the bug. Its all pushed to master quite some time
ago.

Thanks,
Andy

-- 
Andrew Cohen




Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Tue, 05 Sep 2023 06:18:02 GMT) Full text and rfc822 format available.

Notification sent to Sean Whitton <spwhitton <at> spwhitton.name>:
bug acknowledged by developer. (Tue, 05 Sep 2023 06:18:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Andrew Cohen <cohen <at> bu.edu>
Cc: Sean Whitton <spwhitton <at> arizona.edu>, 61539-done <at> debbugs.gnu.org
Subject: Re: bug#61539: 29.0.60; When nnselect-always-regenerate, group info
 gets out-of-date
Date: Mon, 4 Sep 2023 23:16:53 -0700
Andrew Cohen <cohen <at> bu.edu> writes:

> Just forgot to close the bug. Its all pushed to master quite some time
> ago.

OK, thanks.  Closing.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 03 Oct 2023 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 196 days ago.

Previous Next


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