Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 9f / c2b0e1c664908d1df97b4377513e7c4c7d659f
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 D4AFF4196F2\r
6         for <notmuch@notmuchmail.org>; Tue, 13 Apr 2010 23:31:10 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \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 5oGCNBmdJdsq for <notmuch@notmuchmail.org>;\r
16         Tue, 13 Apr 2010 23:31:09 -0700 (PDT)\r
17 Received: from homiemail-a22.g.dreamhost.com (caiajhbdcahe.dreamhost.com\r
18         [208.97.132.74])\r
19         by olra.theworths.org (Postfix) with ESMTP id C53C6431FC1\r
20         for <notmuch@notmuchmail.org>; Tue, 13 Apr 2010 23:31:09 -0700 (PDT)\r
21 Received: from localhost.localdomain (unknown [195.190.188.219])\r
22         by homiemail-a22.g.dreamhost.com (Postfix) with ESMTPA id 2F3E11A805F; \r
23         Tue, 13 Apr 2010 23:31:07 -0700 (PDT)\r
24 From: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
25 To: Notmuch developer list <notmuch@notmuchmail.org>\r
26 Subject: [PATCH] allow to not sort the search results\r
27 Date: Wed, 14 Apr 2010 08:30:55 +0200\r
28 Message-Id: <1271226655-5672-1-git-send-email-Sebastian@SSpaeth.de>\r
29 X-Mailer: git-send-email 1.6.3.3\r
30 X-BeenThere: notmuch@notmuchmail.org\r
31 X-Mailman-Version: 2.1.13\r
32 Precedence: list\r
33 List-Id: "Use and development of the notmuch mail system."\r
34         <notmuch.notmuchmail.org>\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
36         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
38 List-Post: <mailto:notmuch@notmuchmail.org>\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
42 X-List-Received-Date: Wed, 14 Apr 2010 06:31:12 -0000\r
43 \r
44 previously we were always sorting the returned results by some string value,\r
45 but sometimes we might just be interested in the number of results, and don't\r
46 need any sorting.\r
47 \r
48 Also add a --sort=unsorted command line option to notmuch search to test this.\r
49 A search that matches 1200 messages, returns in default sort in 0.982 seconds\r
50 and unsorted in 0.978 seconds with very little variance (with a warm cache).\r
51 Xapian contributor Olly Betts says that the speed gains for a cold cache are\r
52 likely to be much higher though.\r
53 \r
54 Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
55 ---\r
56  lib/notmuch.h    |    3 ++-\r
57  lib/query.cc     |    2 ++\r
58  notmuch-search.c |    2 ++\r
59  3 files changed, 6 insertions(+), 1 deletions(-)\r
60 \r
61 diff --git a/lib/notmuch.h b/lib/notmuch.h\r
62 index a7e66dd..bae48a6 100644\r
63 --- a/lib/notmuch.h\r
64 +++ b/lib/notmuch.h\r
65 @@ -346,7 +346,8 @@ notmuch_query_create (notmuch_database_t *database,\r
66  typedef enum {\r
67      NOTMUCH_SORT_OLDEST_FIRST,\r
68      NOTMUCH_SORT_NEWEST_FIRST,\r
69 -    NOTMUCH_SORT_MESSAGE_ID\r
70 +    NOTMUCH_SORT_MESSAGE_ID,\r
71 +    NOTMUCH_SORT_UNSORTED\r
72  } notmuch_sort_t;\r
73  \r
74  /* Specify the sorting desired for this query. */\r
75 diff --git a/lib/query.cc b/lib/query.cc\r
76 index 10f8dc8..4148f9b 100644\r
77 --- a/lib/query.cc\r
78 +++ b/lib/query.cc\r
79 @@ -148,6 +148,8 @@ notmuch_query_search_messages (notmuch_query_t *query)\r
80         case NOTMUCH_SORT_MESSAGE_ID:\r
81             enquire.set_sort_by_value (NOTMUCH_VALUE_MESSAGE_ID, FALSE);\r
82             break;\r
83 +        case NOTMUCH_SORT_UNSORTED:\r
84 +           break;\r
85         }\r
86  \r
87  #if DEBUG_QUERY\r
88 diff --git a/notmuch-search.c b/notmuch-search.c\r
89 index 4e3514b..854a9ae 100644\r
90 --- a/notmuch-search.c\r
91 +++ b/notmuch-search.c\r
92 @@ -217,6 +217,8 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
93                 sort = NOTMUCH_SORT_OLDEST_FIRST;\r
94             } else if (strcmp (opt, "newest-first") == 0) {\r
95                 sort = NOTMUCH_SORT_NEWEST_FIRST;\r
96 +           } else if (strcmp (opt, "unsorted") == 0) {\r
97 +               sort = NOTMUCH_SORT_UNSORTED;\r
98             } else {\r
99                 fprintf (stderr, "Invalid value for --sort: %s\n", opt);\r
100                 return 1;\r
101 -- \r
102 1.6.3.3\r
103 \r