unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#36765: 27.0.50; gnus-group-split-setup should delay until Gnus has finished starting up
@ 2019-07-22 18:22 Eric Abrahamsen
  2019-07-23 17:21 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2019-07-22 18:22 UTC (permalink / raw)
  To: 36765


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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36765: 27.0.50; gnus-group-split-setup should delay until Gnus has finished starting up
  2019-07-22 18:22 bug#36765: 27.0.50; gnus-group-split-setup should delay until Gnus has finished starting up Eric Abrahamsen
@ 2019-07-23 17:21 ` Lars Ingebrigtsen
  2019-07-23 18:36   ` Eric Abrahamsen
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-23 17:21 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: 36765

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36765: 27.0.50; gnus-group-split-setup should delay until Gnus has finished starting up
  2019-07-23 17:21 ` Lars Ingebrigtsen
@ 2019-07-23 18:36   ` Eric Abrahamsen
  2019-07-26 16:38     ` Eric Abrahamsen
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2019-07-23 18:36 UTC (permalink / raw)
  To: 36765

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Eric Abrahamsen <eric@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.






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36765: 27.0.50; gnus-group-split-setup should delay until Gnus has finished starting up
  2019-07-23 18:36   ` Eric Abrahamsen
@ 2019-07-26 16:38     ` Eric Abrahamsen
  2019-07-27 10:10       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2019-07-26 16:38 UTC (permalink / raw)
  To: 36765

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> Eric Abrahamsen <eric@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?






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36765: 27.0.50; gnus-group-split-setup should delay until Gnus has finished starting up
  2019-07-26 16:38     ` Eric Abrahamsen
@ 2019-07-27 10:10       ` Lars Ingebrigtsen
  2019-07-27 16:19         ` Eric Abrahamsen
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-27 10:10 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: 36765

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





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#36765: 27.0.50; gnus-group-split-setup should delay until Gnus has finished starting up
  2019-07-27 10:10       ` Lars Ingebrigtsen
@ 2019-07-27 16:19         ` Eric Abrahamsen
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2019-07-27 16:19 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 36765, 36765-done

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Eric Abrahamsen <eric@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.





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-27 16:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-22 18:22 bug#36765: 27.0.50; gnus-group-split-setup should delay until Gnus has finished starting up Eric Abrahamsen
2019-07-23 17:21 ` Lars Ingebrigtsen
2019-07-23 18:36   ` Eric Abrahamsen
2019-07-26 16:38     ` Eric Abrahamsen
2019-07-27 10:10       ` Lars Ingebrigtsen
2019-07-27 16:19         ` Eric Abrahamsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).