Re: [notmuch] [PATCH] notmuch: Add tag archive when archiving the mails
authorCarl Worth <cworth@cworth.org>
Wed, 18 Nov 2009 23:51:20 +0000 (00:51 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:36 +0000 (09:35 -0800)
5a/9cb061c0fc1c371986148d988360fd8246f475 [new file with mode: 0644]

diff --git a/5a/9cb061c0fc1c371986148d988360fd8246f475 b/5a/9cb061c0fc1c371986148d988360fd8246f475
new file mode 100644 (file)
index 0000000..ae522dd
--- /dev/null
@@ -0,0 +1,69 @@
+Return-Path: <cworth@cworth.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 00B50431FC0;\r
+       Wed, 18 Nov 2009 15:51:36 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id lLfhSiItCObh; Wed, 18 Nov 2009 15:51:35 -0800 (PST)\r
+Received: from cworth.org (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 04249431FBC;\r
+       Wed, 18 Nov 2009 15:51:34 -0800 (PST)\r
+From: Carl Worth <cworth@cworth.org>\r
+To: Jeffrey Ollie <jeff@ocjtech.us>, Not Much Mail\r
+       <notmuch@notmuchmail.org>\r
+In-Reply-To: <935ead450911181150i4bda379bhcebc3ef52844a0a@mail.gmail.com>\r
+References: <87k4xnrhfp.fsf@linux.vnet.ibm.com>\r
+       <yun3a4b3b50.fsf@aiko.keithp.com>\r
+       <935ead450911181150i4bda379bhcebc3ef52844a0a@mail.gmail.com>\r
+Date: Thu, 19 Nov 2009 00:51:20 +0100\r
+Message-ID: <87639775on.fsf@yoom.home.cworth.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Subject: Re: [notmuch] [PATCH] notmuch: Add tag archive when archiving the\r
+ mails\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 18 Nov 2009 23:51:36 -0000\r
+\r
+On Wed, 18 Nov 2009 13:50:58 -0600, Jeffrey Ollie <jeff@ocjtech.us> wrote:\r
+> On Wed, Nov 18, 2009 at 1:07 PM, Keith Packard <keithp@keithp.com> wrote:\r
+> > I think you can just use 'not tag:inbox' as 'archived' really just means\r
+> > 'doesn't have the inbox tag'.\r
+> \r
+> That resulted in an error for me:\r
+> \r
+> $ notmuch search not tag:inbox\r
+> A Xapian exception occurred: Syntax: <expression> NOT <expression>\r
+> A Xapian exception occurred: Syntax: <expression> NOT <expression>\r
+\r
+Like I said earlier. I think that's a bug we should report to the Xapian\r
+folks.\r
+\r
+Meanwhile, it just occurred to me that we can make "notmuch search not\r
+tag:inbox" work without any change to Xapian.\r
+\r
+For every document we store in the database we put a special term on it\r
+to indicate its type. (We mostly just have documents of type "mail" but\r
+we also have documents of type "timestamp"---see the comment at the top\r
+of lib/database.cc for details.)\r
+\r
+So if we take the string "not tag:inbox" and turn it into "type:mail and\r
+not tag:inbox" then that will work just fine. (That's close to what\r
+we're doing currently, but different. Right now we try to parse the\r
+query "not tag:inbox" on its own and then combine the result with\r
+another query generated from a term representing the "mail" type.)\r
+\r
+-Carl\r