unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] notmuch: Add tag archive when archiving the mails
@ 2009-11-18 15:17 Aneesh Kumar K.V
  2009-11-18 19:07 ` Keith Packard
  0 siblings, 1 reply; 5+ messages in thread
From: Aneesh Kumar K.V @ 2009-11-18 15:17 UTC (permalink / raw)
  To: notmuch


From a2325b950016f39290a0c6f0d6aa3417584eb4e8 Mon Sep 17 00:00:00 2001
From: Aneesh Kumar K.V <aneesh.kumar@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 <aneesh.kumar@linux.vnet.ibm.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] notmuch: Add tag archive when archiving the mails
  2009-11-18 15:17 [PATCH] notmuch: Add tag archive when archiving the mails Aneesh Kumar K.V
@ 2009-11-18 19:07 ` Keith Packard
  2009-11-18 19:50   ` Jeffrey Ollie
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Packard @ 2009-11-18 19:07 UTC (permalink / raw)
  To: Aneesh Kumar K.V, notmuch

[-- Attachment #1: Type: text/plain, Size: 188 bytes --]


> 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@intel.com



[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] notmuch: Add tag archive when archiving the mails
  2009-11-18 19:07 ` Keith Packard
@ 2009-11-18 19:50   ` Jeffrey Ollie
  2009-11-18 20:17     ` Keith Packard
  2009-11-18 23:51     ` Carl Worth
  0 siblings, 2 replies; 5+ messages in thread
From: Jeffrey Ollie @ 2009-11-18 19:50 UTC (permalink / raw)
  To: Not Much Mail

On Wed, Nov 18, 2009 at 1:07 PM, Keith Packard <keithp@keithp.com> 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: <expression> NOT <expression>
A Xapian exception occurred: Syntax: <expression> NOT <expression>

-- 
Jeff Ollie

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] notmuch: Add tag archive when archiving the mails
  2009-11-18 19:50   ` Jeffrey Ollie
@ 2009-11-18 20:17     ` Keith Packard
  2009-11-18 23:51     ` Carl Worth
  1 sibling, 0 replies; 5+ messages in thread
From: Keith Packard @ 2009-11-18 20:17 UTC (permalink / raw)
  To: Jeffrey Ollie, Not Much Mail

[-- Attachment #1: Type: text/plain, Size: 536 bytes --]

On Wed, 18 Nov 2009 13:50:58 -0600, Jeffrey Ollie <jeff@ocjtech.us> wrote:

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

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@intel.com

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] notmuch: Add tag archive when archiving the mails
  2009-11-18 19:50   ` Jeffrey Ollie
  2009-11-18 20:17     ` Keith Packard
@ 2009-11-18 23:51     ` Carl Worth
  1 sibling, 0 replies; 5+ messages in thread
From: Carl Worth @ 2009-11-18 23:51 UTC (permalink / raw)
  To: Jeffrey Ollie, Not Much Mail

On Wed, 18 Nov 2009 13:50:58 -0600, Jeffrey Ollie <jeff@ocjtech.us> wrote:
> On Wed, Nov 18, 2009 at 1:07 PM, Keith Packard <keithp@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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-11-18 23:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-18 15:17 [PATCH] notmuch: Add tag archive when archiving the mails Aneesh Kumar K.V
2009-11-18 19:07 ` Keith Packard
2009-11-18 19:50   ` Jeffrey Ollie
2009-11-18 20:17     ` Keith Packard
2009-11-18 23:51     ` Carl Worth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).