bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#35383: 27.0.50; Complete process of decoding Gnus group names


From: Eric Abrahamsen
Subject: bug#35383: 27.0.50; Complete process of decoding Gnus group names
Date: Sat, 18 May 2019 16:23:39 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> The attached patch should go into master, and then master merged into
>> scratch/gnus-decoded.
>
> [...]
>
>> diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
>> index 2f8a260bf1..16d167613e 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)))
>
> I noticed gnus-start.el (already) uses seq.el functions without first
> loading the library, so how about the following minor addendum?

It does require gnus.el, though, which requires seq, so I figured that
was good enough -- no compiler warnings, anyway.

> (defun gnus-subscribe-alphabetically (newgroup)
> "Subscribe new NEWGROUP and insert it in alphabetical order."
> - (let ((groups (cdr gnus-group-list))
> - before)
> - (while (and (not before) groups)
> - (if (string< newgroup (car groups))
> - (setq before (car groups))
> - (setq groups (cdr groups))))
> + (let ((before (seq-find (lambda (group)
> + (string< newgroup group))
> + (cdr gnus-group-list))))
> (gnus-subscribe-newsgroup newgroup before)))

Looks fine to me! I'll just add this to the patch?

Thanks,
Eric





reply via email to

[Prev in Thread] Current Thread [Next in Thread]