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

From: Jakub Ječmínek <[email-masked]>
Date: Sun, 12 May 2024 22:08:40 +0000

Hello Eric, thanks for looking into it once again.

"Eric Abrahamsen" <[email-masked]> writes:

> So it looks like there's multiple things going on here. First of all,
> the check for bogus groups explicitly excludes secondary select methods.
> Why I do not know, but it's been that way since 2004.

I believe that this is a bug. The documentation says that the `bogus'
group is such that exists in the `.newsrc' file, but isn’t known to the
server (i.e., it isn’t in the active file).

So it must not be active and must not be foreign. But the definition of
foreign group in `gnus-check-bogus-newsgroups' is different from what
was defined by Lars in 1997:

(defun gnus-group-foreign-p (group)
  "Say whether a group is foreign or not."
  (and (not (gnus-group-native-p group))
       (not (gnus-group-secondary-p group))))

We should use this predicate in `gnus-check-bogus-newsgroups' which
fixes the bug we hit along the way (different behaviour between primary
(native) and secondary select methods).

What do you think?

>From a7141acb5361be1c34775bd73434889018f0e9ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Je=C4=8Dm=C3=ADnek?= <[email-masked]>
Date: Sun, 12 May 2024 23:58:22 +0200
Subject: [PATCH] Fix foreign group predicate in gnus-check-bogus-newsgroups

* lisp/gnus/gnus-start.el (gnus-check-bogus-newsgroups): Use correct
predicate for foreign groups.
---
 lisp/gnus/gnus-start.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 05ad4303b5c..b01551d8e22 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -1368,9 +1368,7 @@ gnus-check-bogus-newsgroups
 	(setq info (pop newsrc)
 	      group (gnus-info-group info))
 	(unless (or (gnus-active group)	; Active
-		    (and (gnus-info-method info)
-			 (not (gnus-secondary-method-p
-			       (gnus-info-method info))))) ; Foreign
+                    (gnus-group-foreign-p group)) ; Foreign
 	  ;; Found a bogus newsgroup.
 	  (push group bogus)))
       (if confirm
-- 
2.34.1

Best

-- 
Kuba Ječmínek (http://kubajecminek.cz)