GNU bug report logs - #35383
27.0.50; Complete process of decoding Gnus group names

Previous Next

Package: emacs;

Reported by: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Date: Mon, 22 Apr 2019 18:42:02 UTC

Severity: normal

Tags: fixed

Found in version 27.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #92 received at 35383 <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: Katsumi Yamaoka <yamaoka <at> jpl.org>, 35383 <at> debbugs.gnu.org
Subject: Re: bug#35383: 27.0.50; Complete process of decoding Gnus group names
Date: Sat, 18 May 2019 16:23:39 -0700
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:

> Eric Abrahamsen <eric <at> 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




This bug report was last modified 5 years and 291 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.