Subject: Re: bug#60078: 30.0.50; Gnus: Can't remove groups of select methods that don't exist anymore

From: Eric Abrahamsen <[email-masked]>
Date: Thu, 22 Feb 2024 19:26:08 -0800

Jakub Ječmínek via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <[email-masked]> writes:

> Björn Bidar <[email-masked]> writes:
>
>> Steps to reproduce:
>> 1. Add select method
>> 2. Have a group either created before or in Gnus
>> 3. Launch Gnus
>> 4. Quit Gnus
>> 5. Remove select method
>> 6. Relaunch Gnus
>> 7. execute gnus-group-check-bogus-groups or try to delete a group in
>> Gnus
>>
>> Result:
>> gnus-group-expunge-group: nil does not support expunging
>> gnus-get-function: Trying to require a method that doesn’t exist [2
>> times]
>>
>> Expected result:
>> Groups gone, diagnostic message if needed.
>>
>> Either Gnus doesn't find bogus groups for no longer existing select
>> methods or can't delete them.
>
> Hello Björn, thanks for the bug report. I believe that the "correct" way
> to deal with such groups is simply to kill them (C-k in *Group* buffer).
>
> The documenatation says the following about the bogus group:
>
> A group that exists in the ‘.newsrc’ file, but isn’t known to the server
> (i.e., it isn’t in the active file), is a _bogus group_.  This means
> that the group probably doesn’t exist (any more).
>
> So basically if you remove the select method corresponding to a
> particular group then Gnus is not able to check for bogus groups.

My understanding of checking for bogus group is that it should handle
precisely these circumstances: removing groups that no longer have a
corresponding select method.

I tried Björn's recipe in the gnus-mock package, which is the closest
thing I've got to a uncustomized Gnus. Replacing the principle select
method (previously nnmaildir) with nnnil, restarting Gnus, and running
"b", correctly prompted me to remove the three groups that had
previously belonged to the nnmaildir server.

I'm guessing that Björn has some expunging-related customization that
attempts to expunge messages early on, maybe during the active-file
reading that happens as the first step of checking for bogus groups?
Gnus is trying to get the nonexistent select method to expunge its
articles before it has a chance to remove the groups.

Just a guess...