[notmuch] [PATCH] notmuch: Add Maildir directory name as tag name for messages

Dirk-Jan C. Binnema djcb.bulk at gmail.com
Sun Nov 22 02:37:49 PST 2009

>>>>> "Carl" == Carl Worth <cworth at cworth.org> writes:

    Carl> On Sun, 22 Nov 2009 00:25:43 +0100, Michiel Buddingh'
    Carl> <michiel at michielbuddingh.net> wrote:

    Carl> Hi Michel, welcome to Notmuch!

    >> Any attempt to match tags up to directories will eventually have 
    >> to deal with with the fact that tags can't be neatly mapped onto 
    >> them.  If I remove a directory-tag from a message, does this 
    >> mean the message is removed from that directory?  What if a 
    >> message has two directory-tags, does it mean it's present in both
    >> directories?

    Carl> Right. We definitely don't want a strong mapping here. I think one
    Carl> answer could be that the initial import is different and can take the
    Carl> directory names as a "hint" for initializing tag values. After that,
    Carl> they are just tags in the database and the user can do whatever they
    Carl> want.

In 'mu' I took a slightly different approach, by simply allowing for searches
on the path to the message; ie., by adding the path as just another property
of the message, just like subject: or from:.

Now, the trouble with that the path of a message is not very stable -- people
move messages around. In 'mu' this was handled by simply considering the moved
message as a new one, and removing message from the database whose paths do
not point to message anymore. This makes things quite robust against people
moving things around or deleting them. Tags could be connected to the
hopefully unique Maildir file name then. 

    Carl> 	notmuch search tag:foo and not tag:foo-search
    Carl> 	notmuch search tag:foo-search and not tag:foo

    Carl> So even if in the end the user comes up with something that could
    Carl> replace the original tag, it's probably still beneficial to have it
    Carl> there when starting out.

So, an alternative would be something like:
             notmuch search path:inbox

But this requires notmuch to be able to update things when paths change.

Best wishes,

Dirk-Jan C. Binnema                  Helsinki, Finland
e:djcb at djcbsoftware.nl           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

More information about the notmuch mailing list