Subject: Re: bug#35130: 27.0.50; gnus cannot save

From: Eric Abrahamsen <[email-masked]>
Date: Fri, 03 May 2019 12:58:10 -0700

On 05/01/19 10:58 AM, James Cloos wrote:
>>>>>> "EA" == Eric Abrahamsen <[email-masked]> writes:
>
> EA> Well, I typed that sequence, and nothing special happened. I saw several
> EA> groups I hadn't looked at in a decade or so, caught them up, and nothing
> EA> happened after that. I'm not sure what I was supposed to see...
>
> Perhaps it is specific to nnimap?
>
> In any case, it is a regression.  And a bug.
>
> The new groups were always sorted alphabetically by name when they were added.
> You changes should not break that.
>
> Out of order makes it vastly more difficult to set them all to their new
> levels.

Yes, I wasn't saying this wasn't a bug, I was trying to figure out
exactly what was going on. Would you try the attached patch and see if
it fixes the problem?

Eric

diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 2f8a260bf1..17ee4357e8 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -583,11 +583,11 @@ gnus-subscribe-randomly
 
 (defun gnus-subscribe-alphabetically (newgroup)
   "Subscribe new NEWGROUP and insert it in alphabetical order."
-  (let ((groups (cdr gnus-newsrc-alist))
+  (let ((groups (cdr gnus-group-list))
 	before)
     (while (and (not before) groups)
-      (if (string< newgroup (caar groups))
-	  (setq before (caar groups))
+      (if (string< newgroup (car groups))
+	  (setq before (car groups))
 	(setq groups (cdr groups))))
     (gnus-subscribe-newsgroup newgroup before)))