all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: 36765@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <87sgqseonx.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87lfwq6i9u.fsf@ericabrahamsen.net>

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?






  reply	other threads:[~2019-07-26 16:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2019-07-27 10:10       ` Lars Ingebrigtsen
2019-07-27 16:19         ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgqseonx.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=36765@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.