Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 00B50431FC0; Wed, 18 Nov 2009 15:51:36 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lLfhSiItCObh; Wed, 18 Nov 2009 15:51:35 -0800 (PST) Received: from cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 04249431FBC; Wed, 18 Nov 2009 15:51:34 -0800 (PST) From: Carl Worth To: Jeffrey Ollie , Not Much Mail In-Reply-To: <935ead450911181150i4bda379bhcebc3ef52844a0a@mail.gmail.com> References: <87k4xnrhfp.fsf@linux.vnet.ibm.com> <935ead450911181150i4bda379bhcebc3ef52844a0a@mail.gmail.com> Date: Thu, 19 Nov 2009 00:51:20 +0100 Message-ID: <87639775on.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [notmuch] [PATCH] notmuch: Add tag archive when archiving the mails X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Nov 2009 23:51:36 -0000 On Wed, 18 Nov 2009 13:50:58 -0600, Jeffrey Ollie wrote: > On Wed, Nov 18, 2009 at 1:07 PM, Keith Packard 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: NOT > A Xapian exception occurred: Syntax: NOT 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