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 536BC431FAF for ; Wed, 18 Jan 2012 06:49:21 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "Date" X-Spam-Flag: NO X-Spam-Score: -0.367 X-Spam-Level: X-Spam-Status: No, score=-0.367 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, INVALID_DATE=0.432, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled 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 Xw9naQnzS+70 for ; Wed, 18 Jan 2012 06:49:20 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 89F63431FAE for ; Wed, 18 Jan 2012 06:49:20 -0800 (PST) Received: by werp13 with SMTP id p13so1473452wer.26 for ; Wed, 18 Jan 2012 06:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=content-type:mime-version:content-transfer-encoding:date:to :message-id:from:subject:date; bh=EpMRqTEe6SHLxwgYNqI7/nPHJau94mFwk4vdAa3lEF4=; b=kHBb472hhdckrCXRWfK+JxU9koN47oTWiLL1X9fB6pdP7PdAlvvt0Kyxo2IdqhmVVR Ljo6JhicYgruQLTfYRZ5luIRme1uXMQtbmru3uDzv0XHTgPsIAraQWUt4Qp5PK5e/4lW g/ROeN1HfsDEcnK4S+MMLlohDJTG0ueYmCjUk= Received: by 10.216.138.101 with SMTP id z79mr8270845wei.7.1326898159313; Wed, 18 Jan 2012 06:49:19 -0800 (PST) Received: from localhost (dhcp-91-036.inf.ed.ac.uk. [129.215.91.36]) by mx.google.com with ESMTPS id ek1sm22839080wib.10.2012.01.18.06.49.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 18 Jan 2012 06:49:16 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Date: Wed, 18 Jan 2012 14:48:23 -0000 To: Notmuch Mail Message-ID: <20120118144823.23822.46971@megatron> From: Patrick Totzke Subject: [feature request] thread-based queries Date: Wed, 18 Jan 2012 14:48:23 +0000 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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 Jan 2012 14:49:21 -0000 Hi everyone, A recent discussion on alot's issue tracker[0] made it clear that it might= be useful to have a thread-based matching for queries as an alternative to the current message based approac= h: Consider a thread with two messages, one has a single tag 'flagged', the ot= her a single tag 'unread'. Now the thread doesn't match "tag:flagged AND tag:unread" as it doesn't con= tain any matching messages. However, listing the tags of this thread accumulates to ['flagged', 'unread= ']. As far as I know, there is no way one can tell notmuch to evaluate the quer= y with threads as atomic entities instead of messages so that the thread in the example above matches. I woul= d like to see such a switch in = libnotmuch and the python bindings, maybe as parameter to `notmuch_query_cr= eate` or as something similar to = `notmuch_query_set_sort`. I am aware that I can simulate the intended behaviour by rewriting the quer= y myself, but I think such a feature makes sense not only for alot users and should be implemente= d at a lower level. Moreover, I wouldn't be surprised if doing this at a library level is less = painful than higher up as Xapian has to parse query formulae anyway and hence should offer some co= nvenience methods for dealing with them. Please correct me if I'm wrong here or have just overlooked previous discus= sions/solutions for this issue. Best, /p [o]: https://github.com/pazz/alot/issues/270