[ANNOUNCE] mutt with notmuch support

Jan Pobrislo ccx at webprojekty.cz
Tue Jan 3 15:31:30 PST 2012


On Tue, 3 Jan 2012 13:39:38 +0100
Karel Zak <kzak at redhat.com> wrote:

> 
> This is not another curses front-end for notmuch, this is mutt :-)
> 
> I have forked mutt to seriously integrate notmuch to this excellent
> e-mail client. I don't want to use symlinks or any other hacks to
> emulate virtual folders. My wish is mutt linked with libnotmuch.

Good to hear!

First, I'll shamelessly plug in my set of scripts that do the dirty work by
using symlinked maildirs to interact with any maildir capable mail reader.
It's mainly intended to be interface from shell, calling out to mutt or any
mail reader only when necessary, so it's somewhat reverse paradigm to yours.

view @ http://webprojekty.cz/ccx/loggerhead/zmuch/files
bzr branch http://webprojekty.cz/ccx/bzr/zmuch

Sadly I had to take hiatus mid-rewrite of it, but several interesting points
came up when I was talking about it with cworth and others.

We agreed that we wanted to standardize several features currently present in
emacs UI, so we can share configuration among several implementations. Most
important of these were:

saved searches
--------------

This is the feature I started writing my scripts for. I wanted to refer by a
simple shorthand to complex queries. I know emacs UI has some notion of
remembered queries, but I haven't really bothered trying it out. I assume you
will want to represent these as separate mailboxes, maybe shown using the
sidebar patch, so one has quick overview what's new in which ML.

The way I do this is that command:

$ zmuch search :foss and not :notmuch

will expand to:

$ notmuch search ( to:lists.xmms.se or ( to:cairo-announce at cairographics.org
    or to:cairo at cairographics.org ) or ( to:notmuch at notmuchmail.org or
	to:notmuch-request at notmuchmail.org ) ) and not (
	to:notmuch at notmuchmail.org or to:notmuch-request at notmuchmail.org )

Which would be bit too much to type by hand, even for so few lists.
This would be using .notmuch-config with something like this:

[zmuch_searches]
xmms2=to:lists.xmms.se
cairo=to:cairo-announce at cairographics.org or to:cairo at cairographics.org
foss=:xmms2 or :cairo or :notmuch

Subset of this issue is the question: How to display overview of such saved
queries in a sensible manner? Mutt probably can't go beyond unread/total
number of messages for each query and that's actually what I have currently
implemented. Given the config:

[interesting]
query=is:unread and not ( is:spam or is:mute )

[zmuch_show]
selected=twisted;notmuch;gentoo-cs;cajovna;system;inbox

it would show number of interesting/total messages for each of the listed
saved query. Much nicer generalisation was then discussed on IRC, where you
could use regular saved search instead of separate [interesting] entry,
allowing you to have several such queries, eg. for displaying
unread/flagged/muted/total or anything your heart desires.

way to call notmuch
-------------------

This might be feature you'll be probably missing due to using libnotmuch
directly instead of calling out executable as emacs UI does, but I find it
really useful to be able to layer functionality unix-style. Not only you can
run remote notmuch via ssh, but also my saved search implementation does this
by expanding arguments passed to the notmuch executable and as such is usable
from any UI that has configurable executable to call instead of "notmuch".

colors
------

Again dunno how much this applies to mutt, as it has it's own coloring
paradigm, but I find it neat to be able to do something like this globally:

[tag_colors]
flagged=%F{red}
mute=%B%F{black}
spam=%F{magenta}
unread=%F{cyan}
replied=%F{yellow}
sent=%F{green}
attachment=%B

This is syntax that zsh uses for it's print/prompt formatting and is obviously
ANSI VT specific (%B is for bold/standout). GUI lovers will probably want #RGB
scheme too.


HTH bring up some good ideas and discussion.


More information about the notmuch mailing list