unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Sean Whitton <spwhitton@spwhitton.name>
To: 61539@debbugs.gnu.org
Cc: cohen@andy.bu.edu
Subject: bug#61539: 29.0.60; When nnselect-always-regenerate, group info gets out-of-date
Date: Wed, 15 Feb 2023 12:47:18 -0700	[thread overview]
Message-ID: <87lekyaeyh.fsf@melete.silentflame.com> (raw)

X-debbugs-cc: cohen@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





             reply	other threads:[~2023-02-15 19:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15 19:47 Sean Whitton [this message]
2023-02-18 20:20 ` bug#61539: 29.0.60; When nnselect-always-regenerate, group info gets out-of-date Sean Whitton
2023-03-11 21:18   ` Sean Whitton
2023-09-04 19:46     ` stefankangas
2023-09-04 23:21       ` Andrew Cohen
2023-09-05  6:16         ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lekyaeyh.fsf@melete.silentflame.com \
    --to=spwhitton@spwhitton.name \
    --cc=61539@debbugs.gnu.org \
    --cc=cohen@andy.bu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).