[notmuch] [PATCH] notmuch: Add tag archive when archiving the mails

Carl Worth cworth at cworth.org
Wed Nov 18 15:51:20 PST 2009


On Wed, 18 Nov 2009 13:50:58 -0600, Jeffrey Ollie <jeff at ocjtech.us> wrote:
> On Wed, Nov 18, 2009 at 1:07 PM, Keith Packard <keithp at keithp.com> wrote:
> > I think you can just use 'not tag:inbox' as 'archived' really just means
> > 'doesn't have the inbox tag'.
> 
> That resulted in an error for me:
> 
> $ notmuch search not tag:inbox
> A Xapian exception occurred: Syntax: <expression> NOT <expression>
> A Xapian exception occurred: Syntax: <expression> NOT <expression>

Like I said earlier. I think that's a bug we should report to the Xapian
folks.

Meanwhile, it just occurred to me that we can make "notmuch search not
tag:inbox" work without any change to Xapian.

For every document we store in the database we put a special term on it
to indicate its type. (We mostly just have documents of type "mail" but
we also have documents of type "timestamp"---see the comment at the top
of lib/database.cc for details.)

So if we take the string "not tag:inbox" and turn it into "type:mail and
not tag:inbox" then that will work just fine. (That's close to what
we're doing currently, but different. Right now we try to parse the
query "not tag:inbox" on its own and then combine the result with
another query generated from a term representing the "mail" type.)

-Carl


More information about the notmuch mailing list