--- /dev/null
+Return-Path: <tomi.valkeinen@gmail.com>\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 39611431FBF\r
+ for <notmuch@notmuchmail.org>; Tue, 19 Nov 2013 04:40:32 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
+ RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 Y0BH+nfC8Cnj for <notmuch@notmuchmail.org>;\r
+ Tue, 19 Nov 2013 04:40:08 -0800 (PST)\r
+Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com\r
+ [209.85.217.180]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 91D96431FBC\r
+ for <notmuch@notmuchmail.org>; Tue, 19 Nov 2013 04:40:08 -0800 (PST)\r
+Received: by mail-lb0-f180.google.com with SMTP id w6so2532651lbh.39\r
+ for <notmuch@notmuchmail.org>; Tue, 19 Nov 2013 04:40:04 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject\r
+ :references:in-reply-to:content-type;\r
+ bh=Y2pzQekBi6H7thor2D/iNVHkMUzKVPGYE9sLSx/8Mf4=;\r
+ b=ux9Z4rZtyjWJ77FzTC7oJgQGg3DV4zf8sKI3aD4UOtuRca4agsaxqrXs23m/QzeQRq\r
+ OZZYhCMQLSHOrfQr/HwD3jTbYnKZmNQcC7HQNJIUE5RkpL9EmsrYA08JINDAuPsxxZJe\r
+ DbA2QLLL6XWiaX9dzWIlGuvUKGnb3HncYefybIp8AcMvIsG/SY20crLY7SG3cCyYq4Fd\r
+ ekrhqtKXoGb3JbD3QAh9FTtvrnycFiHEqrNcfY/6MjIqBJr00rSrsD4L7nuu3SjXnHV0\r
+ EBCKgf0ftwCXpa1s+0d5KekrMiMSuFqTcOdlDwT+OO4ygvbwoQxoQptTx6lzxvZPcwiy\r
+ hB+Q==\r
+X-Received: by 10.112.73.3 with SMTP id h3mr18029116lbv.4.1384864802092;\r
+ Tue, 19 Nov 2013 04:40:02 -0800 (PST)\r
+Received: from [192.168.1.3] (a91-156-160-115.elisa-laajakaista.fi.\r
+ [91.156.160.115]) by mx.google.com with ESMTPSA id\r
+ xc10sm15735270lbb.6.2013.11.19.04.39.59 for <multiple recipients>\r
+ (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);\r
+ Tue, 19 Nov 2013 04:40:00 -0800 (PST)\r
+Sender: Tomi Valkeinen <tomi.valkeinen@gmail.com>\r
+Message-ID: <528B5C1F.4050908@iki.fi>\r
+Date: Tue, 19 Nov 2013 14:39:59 +0200\r
+From: Tomi Valkeinen <tomi.valkeinen@iki.fi>\r
+User-Agent: Mozilla/5.0 (X11; Linux x86_64;\r
+ rv:24.0) Gecko/20100101 Thunderbird/24.1.0\r
+MIME-Version: 1.0\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: notmuch-lib questions and observations\r
+References: <528A26F4.3040006@iki.fi> <87bo1gio9c.fsf@nikula.org>\r
+In-Reply-To: <87bo1gio9c.fsf@nikula.org>\r
+X-Enigmail-Version: 1.6\r
+Content-Type: multipart/signed; micalg=pgp-sha1;\r
+ protocol="application/pgp-signature";\r
+ boundary="oxINwwJVIHxoqmI1oHjGuBQ3Al986pbba"\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\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: Tue, 19 Nov 2013 12:40:32 -0000\r
+\r
+This is an OpenPGP/MIME signed message (RFC 4880 and 3156)\r
+--oxINwwJVIHxoqmI1oHjGuBQ3Al986pbba\r
+Content-Type: text/plain; charset=ISO-8859-1\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+On 2013-11-19 14:12, Jani Nikula wrote:\r
+> On Mon, 18 Nov 2013, Tomi Valkeinen <tomi.valkeinen@iki.fi> wrote:\r
+>> Hi,\r
+>>\r
+>> I found out about notmuch quite recently, and now I've been tinkering\r
+>> with it, prototyping a GUI client. I have some questions and observati=\r
+ons:\r
+>=20\r
+> Hello Tomi, glad you've found notmuch too! ;)\r
+\r
+Well, I'm still using Thunderbird... ;)\r
+\r
+>> 3.\r
+>>\r
+>> How is a client using notmuch supposed to find out there are new\r
+>> messages, and which messages are new?\r
+>=20\r
+> 'notmuch new' tags any new messages it finds with tags specified in\r
+> new.tags config option (man notmuch-config), "inbox" and "unread" by\r
+> default. Some people like to change that to "new", and run a post-new\r
+> hook (man notmuch-hooks) that looks at messages matching tag:new,\r
+> retagging as desired.\r
+>=20\r
+>> My current thought is to make 'notmuch new' run a script that tags the=\r
+\r
+>> messages, and make it add a 'new-gui' or such tag to all new messages.=\r
+\r
+>> The client would then periodically make a query for that tag, and at t=\r
+he\r
+>> same time remove the tag for any returned messages.\r
+>=20\r
+> As said, 'notmuch new' does that, and it can also run a script for you.=\r
+\r
+\r
+I think I wasn't very clear on what I meant. I was thinking about the\r
+behavior that graphical mail clients have: they periodically refresh the\r
+emails, showing new ones if there are any, and they'll show some icon or\r
+such which tells the user this email is "new" (which could mean received\r
+in the last periodic refresh).\r
+\r
+So with notmuch, the client would somehow need to know that there has\r
+been changes in the database, and then know which emails are new.\r
+\r
+For the former, I have no good idea as there doesn't seem to be any way\r
+to find out the db was changed since the last open. For the latter, I\r
+guess the tagging method I mentioned above should work.\r
+\r
+If the xapian document id was available, I believe it could also be used\r
+for the latter, as it should always be increasing.\r
+\r
+>> 5.\r
+>>\r
+>> This one is just a vague thought that came to my mind. At the moment\r
+>> notmuch hides Xapian totally behind notmuch's interface, which probabl=\r
+y\r
+>> makes things simpler (and gives a nice C API), but also (afaik) preven=\r
+ts\r
+>> using Xapian features that are not at the moment supported in the\r
+>> notmuch API.\r
+>>\r
+>> I wonder how would an approach work where notmuch would be a bit more\r
+>> like a helper library, allowing full use of Xapian's features but maki=\r
+ng\r
+>> it simple to manage notmuch database. So, for example, when making a\r
+>> query, you'd create a Xapian query with notmuch, and then use Xapian t=\r
+o\r
+>> run the query.\r
+>>\r
+>> I don't have anything clear in mind, and obviously Xapian being C++\r
+>> might make the whole idea unimplementable.\r
+>=20\r
+> I think the database implementation has been abstracted on purpose, so\r
+> we could, at least in theory, switch from xapian to something else. I\r
+> don't know how feasible that would be though. I think Austin has\r
+> experimented with that.\r
+\r
+Ah, a valid point, I didn't think of that.\r
+\r
+ Tomi\r
+\r
+\r
+\r
+--oxINwwJVIHxoqmI1oHjGuBQ3Al986pbba\r
+Content-Type: application/pgp-signature; name="signature.asc"\r
+Content-Description: OpenPGP digital signature\r
+Content-Disposition: attachment; filename="signature.asc"\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.14 (GNU/Linux)\r
+Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/\r
+\r
+iQIcBAEBAgAGBQJSi1wfAAoJEPo9qoy8lh71+UUP/j6LEk8MvjGaLXzx9Wm1x2DI\r
+PqFtZH/dFXjKwYOi4PJjVTmJdocCR+O0e+V3CijjufsZubANSoHYLt+OLXBuCmoW\r
+lfpZ5t8SLe/JNErCwJaQTjtyUeAfiPlmc/6uiui1sFaktmC3Gs5CbHlyEBoclSah\r
+M2XXFedYcAg7IUTzTJLy6ML1GiCakJpFSMnI5MPnc5Lper/mGZ56B3Sp4kT4FzKu\r
+c7+XnbItzcBJBf4pRM2AwBly3Ha1i2B6OaKfn4mn+6sWwoXYJtUqxqND72H00B6+\r
+ok2OpYzojLMSVwN3iXDG54oOkBrisSkiqLlWyqnuvy9ZaIGEr0s3A2QTQzD+d69J\r
+X8YpolAP919difctmFDEVizoOXartpQDO+Sn9nwmZX05PwZcPlA51qWMiQdgYQwK\r
+7EvwLfvAbYEFPR7FCuC2ar45DQguGANDW0+5M1RU1wF22V5XqO9svSxGWF3T/vjH\r
+M+NFf2M9vvF9FkCaHHF6CowVr7eIMlSKQwhwvTQSgLwxEu0ZCbRLnTMMr3pL9gYC\r
+3WJ6EepSUimunQT8g5uBXKaXUOk9Dhbt+f/HCDyVy1x3bNrp3J2zAJsJsTf92s6D\r
+cRrNxO3uu1dX65q4lJDR0Ll1Iit0Zfsf2rM5FUGoIiLGY5Fuwo3tsveb3nfyNsCQ\r
+pfqN+B2DpF3FIjXWVyR2\r
+=zxrZ\r
+-----END PGP SIGNATURE-----\r
+\r
+--oxINwwJVIHxoqmI1oHjGuBQ3Al986pbba--\r