GNU bug report logs - #36765
27.0.50; gnus-group-split-setup should delay until Gnus has finished starting up

Previous Next

Packages: gnus, emacs;

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

Date: Mon, 22 Jul 2019 18:23:01 UTC

Severity: normal

Found in version 27.0.50

Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36765 in the body.
You can then email your comments to 36765 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#36765; Package emacs,gnus. (Mon, 22 Jul 2019 18:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eric Abrahamsen <eric <at> ericabrahamsen.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org. (Mon, 22 Jul 2019 18:23:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; gnus-group-split-setup should delay until Gnus has
 finished starting up
Date: Mon, 22 Jul 2019 11:22:53 -0700
The Gnus manual instructs users to put a call to
`gnus-group-split-setup' in their gnus.el file if they want to skip over
some tedious manual configuration.

The problem with this is that the function has:

  (gnus-group-split-update)
  (when auto-update
    (add-hook 'nnmail-pre-get-new-mail-hook 'gnus-group-split-update))

Meaning that `gnus-group-split-update' is called immediately when this
function is run, which happens before Gnus is done starting up.
split-update calls `gnus-group-split-fancy' which ends up accessing
group parameters on all Gnus groups. Parameter access only works when
gnus-newsrc-hashtb is already initialized. When the hashtb was an
obarray, this process was a silent no-op. Now that they're hashtables,
it signals a type error.

I think a simple solution would be to change the above to:

(add-hook (if auto-update
	      'nnmail-pre-get-new-mail-hook
	    'gnus-started-hook)
	  'gnus-group-split-update)

Ie, if auto-update isn't passed, only run the update once, at start time.




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#36765; Package emacs,gnus. (Tue, 23 Jul 2019 17:22:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 36765 <at> debbugs.gnu.org
Subject: Re: bug#36765: 27.0.50; gnus-group-split-setup should delay until
 Gnus has finished starting up
Date: Tue, 23 Jul 2019 19:21:02 +0200
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> I think a simple solution would be to change the above to:
>
> (add-hook (if auto-update
> 	      'nnmail-pre-get-new-mail-hook
> 	    'gnus-started-hook)
> 	  'gnus-group-split-update)
>
> Ie, if auto-update isn't passed, only run the update once, at start time.

I think that makes sense -- if it doesn't have to be called from
nnmail-pre-get-new-mail-hook; I'm not too familiar with that code.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#36765; Package emacs,gnus. (Tue, 23 Jul 2019 18:41:01 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#36765: 27.0.50;
 gnus-group-split-setup should delay until Gnus has finished starting
 up
Date: Tue, 23 Jul 2019 11:36:20 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> I think a simple solution would be to change the above to:
>>
>> (add-hook (if auto-update
>> 	      'nnmail-pre-get-new-mail-hook
>> 	    'gnus-started-hook)
>> 	  'gnus-group-split-update)
>>
>> Ie, if auto-update isn't passed, only run the update once, at start time.
>
> I think that makes sense -- if it doesn't have to be called from
> nnmail-pre-get-new-mail-hook; I'm not too familiar with that code.

I think the idea is that if `auto-update' is nil, the update should only
happen once, at start-up time. If it's t, it should happen every time
before we check new mail (which will include start-up time, I think).

Anyway, let me make sure this solves the user's error first.





Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#36765; Package emacs,gnus. (Fri, 26 Jul 2019 16:40:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#36765: 27.0.50;
 gnus-group-split-setup should delay until Gnus has finished starting
 up
Date: Fri, 26 Jul 2019 09:38:58 -0700
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>>
>>> I think a simple solution would be to change the above to:
>>>
>>> (add-hook (if auto-update
>>> 	      'nnmail-pre-get-new-mail-hook
>>> 	    'gnus-started-hook)
>>> 	  'gnus-group-split-update)
>>>
>>> Ie, if auto-update isn't passed, only run the update once, at start time.
>>
>> I think that makes sense -- if it doesn't have to be called from
>> nnmail-pre-get-new-mail-hook; I'm not too familiar with that code.
>
> I think the idea is that if `auto-update' is nil, the update should only
> happen once, at start-up time. If it's t, it should happen every time
> before we check new mail (which will include start-up time, I think).
>
> Anyway, let me make sure this solves the user's error first.

Okay, I've heard back from the user. I think the proper solution is:

(add-hook (if auto-update
	      'gnus-get-top-new-news-hook
	    'gnus-read-newsrc-el-hook)
	  #'gnus-group-split-update)

The reasoning being:

The original 'nnmail-pre-get-new-mail-hook runs for all mail backends
*except* nnimap, so the update won't fire if the user only has nnimap
backends. 'gnus-get-top-new-news-hook should do just as well.

Originally I put the non-auto-update on the 'gnus-started-hook, but that
means the update happens *after* the first check for mail, which isn't
ideal. There's also the 'gnus-startup-hook, but that happens before the
newsrc-hashtb is built, so we'd get the same error.
'gnus-read-newsrc-el-hook seems to be the only hook that runs after the
hash table is built, but before new news is fetched.

WDYT?





Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#36765; Package emacs,gnus. (Sat, 27 Jul 2019 10:11:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 36765 <at> debbugs.gnu.org
Subject: Re: bug#36765: 27.0.50; gnus-group-split-setup should delay until
 Gnus has finished starting up
Date: Sat, 27 Jul 2019 12:10:06 +0200
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:

> Okay, I've heard back from the user. I think the proper solution is:
>
> (add-hook (if auto-update
> 	      'gnus-get-top-new-news-hook
> 	    'gnus-read-newsrc-el-hook)
> 	  #'gnus-group-split-update)
>
> The reasoning being:

[...]

> WDYT?

Sounds good.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#36765; Package emacs,gnus. (Sat, 27 Jul 2019 16:20:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 36765 <at> debbugs.gnu.org, 36765-done <at> debbugs.gnu.org
Subject: Re: bug#36765: 27.0.50; gnus-group-split-setup should delay until
 Gnus has finished starting up
Date: Sat, 27 Jul 2019 09:19:40 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> Okay, I've heard back from the user. I think the proper solution is:
>>
>> (add-hook (if auto-update
>> 	      'gnus-get-top-new-news-hook
>> 	    'gnus-read-newsrc-el-hook)
>> 	  #'gnus-group-split-update)
>>
>> The reasoning being:
>
> [...]
>
>> WDYT?
>
> Sounds good.

Thanks -- pushed.




Reply sent to Eric Abrahamsen <eric <at> ericabrahamsen.net>:
You have taken responsibility. (Sat, 27 Jul 2019 16:20:03 GMT) Full text and rfc822 format available.

Notification sent to Eric Abrahamsen <eric <at> ericabrahamsen.net>:
bug acknowledged by developer. (Sat, 27 Jul 2019 16:20:05 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 25 Aug 2019 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 245 days ago.

Previous Next


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