Lazily loading notmuch into Emacs

Sean Whitton spwhitton at spwhitton.name
Tue Jun 2 14:50:02 PDT 2020


Hello David,

On Tue 02 Jun 2020 at 12:41PM +01, David Edmondson wrote:

> I'd hoped that:
>
> (require 'notmuch-mua)
> (setq mail-user-agent 'notmuch-user-agent)
>
> would be sufficient to get things wired up, but it doesn't seem to be.
>
> If we fix that, would it seem more appropriate? If we get it right then
> it shouldn't load any other notmuch code (including notmuch-config.el)
> until you actually use one of the functions.

It's probably better than using advice-add, assuming that bytecompiled
notmuch-mua.el loads quickly.

I wonder if maybe notmuch-mua.el could be split into a small file the
user can 'require in their init, which just has the
define-mail-user-agent call, and then there's a larger .el file
containing an autoload cookie and definition for 'notmuch-mua-mail, and
everything else?

I'm also advising notmuch-jump-search and notmuch-hello, as otherwise I
noticed notmuch-config.el doesn't get loaded if you use one of those
right after starting Emacs.  I think the fix there is to add (require
'notmuch) to the top of notmuch-jump.el and notmuch-hello.el?

-- 
Sean Whitton


More information about the notmuch mailing list