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

2009-11-19 Thread Carl Worth
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


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

2009-11-18 Thread Aneesh Kumar K.V

>From a2325b950016f39290a0c6f0d6aa3417584eb4e8 Mon Sep 17 00:00:00 2001
From: Aneesh Kumar K.V <aneesh.ku...@linux.vnet.ibm.com>
Date: Wed, 18 Nov 2009 20:45:45 +0530
Subject: [PATCH] notmuch: Add tag archive when archiving the mails

This enables us to search for archived mails later

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 87116f9..ec2155a 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -196,6 +196,7 @@ Unlike builtin `next-line' this version accepts no 
arguments."
   (if markread
  (notmuch-show-remove-tag "unread" "inbox")
(notmuch-show-remove-tag "inbox"))
+  (notmuch-show-add-tag "archive")
   (if (not (eobp))
  (forward-char))
   (if (not (re-search-forward notmuch-show-message-begin-regexp nil t))
-- 
1.6.5.2.74.g610f9



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

2009-11-18 Thread Jeffrey Ollie
On Wed, Nov 18, 2009 at 1:07 PM, Keith Packard  wrote:
>
>> This enables us to search for archived mails later
>
> 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 

-- 
Jeff Ollie


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

2009-11-18 Thread Keith Packard
On Wed, 18 Nov 2009 13:50:58 -0600, Jeffrey Ollie  wrote:

> That resulted in an error for me:
> 
> $ notmuch search not tag:inbox
> A Xapian exception occurred: Syntax:  NOT 
> A Xapian exception occurred: Syntax:  NOT 

Yeah, NOT isn't a unary operator in xapian; it's a binary operator that
means 'AND NOT'. The Xapian docs say that if you set the FLAG_PURE_NOT
flag, you'll get the unary behaviour, but I haven't tried that.

--
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: 



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

2009-11-18 Thread Keith Packard

> This enables us to search for archived mails later

I think you can just use 'not tag:inbox' as 'archived' really just means
'doesn't have the inbox tag'.

--
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: