[notmuch] notmuch 'index' mode.

Keith Packard keithp at keithp.com
Fri Nov 20 23:35:29 PST 2009


I posted a patch adding an 'index' mode to notmuch and though I'd
explain my idea. Most mail systems provide a 'folder view' mode which
displays the set of folders and a count of messages in each folder. I
used this myself as the first sort of which messages I want to read.

Notmuch doesn't have folders, but it does have tags, so I thought I'd
take advantage of that, along with the quick searching ability in Xapian
to construct something much like the folder view.

In 'index' mode, notmuch shows a list of 'folders', each of which is
defined by a Xapian query. The new 'notmuch count' command is used to
figure out how many messages matching the query are in the
database. When you hit 'enter' (or click the mouse) on any line, it
executes the search for real using the notmuch-search command.

Here's the set of indexes I'm using right now (oddly, it looks a lot
like the set of tags I auto-configure in my notmuch-poll script).

(setq notmuch-indexes '(("inbox" . "tag:inbox")
			("me" . "tag:inbox AND tag:me")
			("announce" . "tag:inbox AND tag:announce")
			("bugs" . "tag:inbox AND tag:bugs")
			("cairo" . "tag:inbox AND tag:cairo")
			("debian" . "tag:inbox AND tag:debian");
			("hackers" . "tag:inbox AND tag:hackers")
			("intel" . "tag:inbox AND tag:intel")
			("mesa" . "tag:inbox AND tag:mesa")
			("notmuch" . "tag:inbox AND tag:notmuch")
			("oes" . "tag:inbox AND tag:oes")
			("rockets" . "tag:inbox AND tag:rockets")
			("x" . "tag:inbox AND tag:x")
			("xorg-board" . "tag:inbox AND tag:xorg-board")
			("xpatches" . "tag:inbox AND tag:x AND tag:patch")))

And here's what I see in the *notmuch-index* buffer:

inbox		3
me		3
announce	0
bugs		0
cairo		0
debian		0
hackers		0
intel		0
mesa		0
notmuch		0
oes		0
rockets		0
x		0
xorg-board	0
xpatches	0

This is all pretty simple, and it does much of what I want. However, one
could always get more :-)

One missing piece here is that the searches don't have a
total/unread count. Because the 'notmuch count' command is so fast
(notmuch count the returns 532891 on my machine, and takes 0.240
seconds), we really could count the number of messages matching a single
tag and then *also* count the number of messages matching that tag and
the inbox tag.

Another missing piece is that these should be shared with the
notmuch-poll script, probably via the .notmuch-config file. I do like
that I can have some entries here that aren't in my notmuch-poll script.

It might be nice to make this hierarchical as I used to do with
evolution's vfolder stuff -- an 'intel' folder with an 'intel/unread'
sub-folder. That would be done with simple conjunctions of tags, but
providing some structure on the screen might be nice.

I'm also wondering if we should elide, or at least change the appearance,
of lines which match zero messages.

I'd also like to be able to get the system to display my mail in three
panes -- one with the index, one with the current search and the last
with the current thread. Getting those laid out on the screen correctly
and letting you get them back to that layout easily would make notmuch
look a lot more like other email clients, a form I've found fairly
functional as I do not generally read mail in a linear fashion.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20091120/7c14d629/attachment.pgp>


More information about the notmuch mailing list