1 Return-Path: <Sebastian@SSpaeth.de>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id D36EF418C25
\r
6 for <notmuch@notmuchmail.org>; Thu, 15 Apr 2010 23:38:54 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5
\r
12 tests=[BAYES_00=-1.9] autolearn=ham
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 5iKU0DIEB-Ag for <notmuch@notmuchmail.org>;
\r
16 Thu, 15 Apr 2010 23:38:54 -0700 (PDT)
\r
17 Received: from homiemail-a20.g.dreamhost.com (caiajhbdcaib.dreamhost.com
\r
19 by olra.theworths.org (Postfix) with ESMTP id F38EC431FC1
\r
20 for <notmuch@notmuchmail.org>; Thu, 15 Apr 2010 23:38:53 -0700 (PDT)
\r
21 Received: from localhost.localdomain (unknown [195.190.188.219])
\r
22 by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPA id BBF3E7EC060;
\r
23 Thu, 15 Apr 2010 23:38:52 -0700 (PDT)
\r
24 From: Sebastian Spaeth <Sebastian@SSpaeth.de>
\r
25 To: Notmuch developer list <notmuch@notmuchmail.org>
\r
26 Subject: [PATCH 1/3] query.cc: allow to return query results unsorted
\r
27 Date: Fri, 16 Apr 2010 08:38:46 +0200
\r
28 Message-Id: <1271399928-6166-1-git-send-email-Sebastian@SSpaeth.de>
\r
29 X-Mailer: git-send-email 1.7.0.4
\r
30 In-Reply-To: <87eiifj433.fsf@SSpaeth.de>
\r
31 References: <87eiifj433.fsf@SSpaeth.de>
\r
32 X-BeenThere: notmuch@notmuchmail.org
\r
33 X-Mailman-Version: 2.1.13
\r
35 List-Id: "Use and development of the notmuch mail system."
\r
36 <notmuch.notmuchmail.org>
\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
38 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
40 List-Post: <mailto:notmuch@notmuchmail.org>
\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
44 X-List-Received-Date: Fri, 16 Apr 2010 06:38:55 -0000
\r
46 Previously, we always sorted the returned results by some string value,
\r
47 (newest-to-oldest by default), however in some cases (as when applying
\r
48 tags to a search result) we are not interested in any special order.
\r
50 This introduces a NOTMUCH_SORT_UNSORTED value that does just that. It is
\r
51 not used at the moment anywhere in the code.
\r
53 Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
\r
55 lib/notmuch.h | 3 ++-
\r
57 2 files changed, 4 insertions(+), 1 deletions(-)
\r
59 diff --git a/lib/notmuch.h b/lib/notmuch.h
\r
60 index a7e66dd..bae48a6 100644
\r
63 @@ -346,7 +346,8 @@ notmuch_query_create (notmuch_database_t *database,
\r
65 NOTMUCH_SORT_OLDEST_FIRST,
\r
66 NOTMUCH_SORT_NEWEST_FIRST,
\r
67 - NOTMUCH_SORT_MESSAGE_ID
\r
68 + NOTMUCH_SORT_MESSAGE_ID,
\r
69 + NOTMUCH_SORT_UNSORTED
\r
72 /* Specify the sorting desired for this query. */
\r
73 diff --git a/lib/query.cc b/lib/query.cc
\r
74 index 10f8dc8..4148f9b 100644
\r
77 @@ -148,6 +148,8 @@ notmuch_query_search_messages (notmuch_query_t *query)
\r
78 case NOTMUCH_SORT_MESSAGE_ID:
\r
79 enquire.set_sort_by_value (NOTMUCH_VALUE_MESSAGE_ID, FALSE);
\r
81 + case NOTMUCH_SORT_UNSORTED:
\r