[PATCH] emacs: Add notmuch-hello.el, a friendly frontend to notmuch

David Edmondson dme at dme.org
Mon Apr 26 02:36:28 PDT 2010


On Fri, 23 Apr 2010 13:13:01 -0700, Carl Worth <cworth at cworth.org> wrote:
>   * This should be integrated such that (require 'notmuch) provides the
>     notmuch-hello functionality. That's our documented access point for
>     getting at notmuch functionality.

I'll do this, but I wonder if it is actually good advice. It causes
notmuch.el (and anything that requires) to be loaded immediately. This
will typically happen before any of a users' customisation settings are
loaded (as `custom-set-variables', etc. generally happens right at the
bottom of .emacs).

A result of this is that notmuch can't use any of the customisation
settings to adapt its' behaviour at load time. A example is (about which
more lower down):

>   * I would *love* a simple way to import my existing notmuch-folder
>     configuration into notmuch-hello. Bonus points if this happens
>     automatically.

notmuch-hello.el has:

(defcustom notmuch-hello-saved-searches notmuch-folders
  "A list of saved searches to display."
  :type '(alist :key-type string :value-type string)
  :group 'notmuch)

So if `notmuch-folders' is set before notmuch-hello.el is loaded, you
get some saved-searches copied from your folders (but this won't
override any specific settings you made for
`notmuch-hello-saved-searches').

Relying on the order in general is bad
(cf. `notmuch-search-authors-width'), but it can allow us to provide
some useful functionality.

If we don't want users to "(require 'notmuch)" we'd probably have to
suggest one or more autoloads - perhaps even provide a file with a bunch
of autoloads in it. Oh, or "(require 'notmuch)" should just load
something that has the autoloads (d'oh!) and some
`define-mail-user-agent' goop so that `compose-mail' does the right
thing.

I'll try to produce a patch for this last thing.

>   * The logo background is gray on my white-background emacs. That
>     looks odd.

Patch sent.

>   * It would be great if point were in the search bar right when this
>     mode started.

This is customisable, and I see that you changed the default ;-)

>   * I'd like the saved searches to appear before the recent searches I
>     think.

Did you come to any conclusion about this?

>   * I'm not sure how useful the numbered shortcuts are for the recent
>     searches. We want to encourage people to move to saved searches
>     instead, (and the recent searches are quite transient anyway). So do
>     we really need these? [I mistook them for message counts at
>     first.]

Patch sent which removes them.

>   * Repeating a recent search by pressing RET on it creates a new
>     identical search which doesn't seem all that useful.

Patch sent.

>   * I would *love* a simple way to import my existing notmuch-folder
>     configuration into notmuch-hello. Bonus points if this happens
>     automatically.

We could have `notmuch-hello' use `notmuch-folders' if
`notmuch-hello-saved-searches' is `nil'. Would that help?

> Finally, I'm quite inclined to make `notmuch' invoke this mode, so
> think about that.

It seems straightforward, I'll produce a patch.

dme.
-- 
David Edmondson, http://dme.org


More information about the notmuch mailing list