1 Return-Path: <markwalters1009@gmail.com>
\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 66FB9431FAF
\r
6 for <notmuch@notmuchmail.org>; Tue, 20 Mar 2012 13:12:18 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0.201 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,
\r
14 RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id ITmw5av-scoI for <notmuch@notmuchmail.org>;
\r
18 Tue, 20 Mar 2012 13:12:16 -0700 (PDT)
\r
19 Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com
\r
20 [209.85.212.173]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id E8407431FCF
\r
23 for <notmuch@notmuchmail.org>; Tue, 20 Mar 2012 13:12:09 -0700 (PDT)
\r
24 Received: by wibhq7 with SMTP id hq7so4620566wib.2
\r
25 for <notmuch@notmuchmail.org>; Tue, 20 Mar 2012 13:12:08 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
\r
28 bh=pYcJA5VPsqPPDjf0Wt9fVZi9BDODpIN4pVN6nXuWnYM=;
\r
29 b=f448S5cfeV/GXdlwQYne+Iw3eN6LYFLmmSAIBTkvQTbip5yDYmTd69MlpYdgcMTt8r
\r
30 kRXKhSEC4PnBEBbRD8gMarHSSLSSapackSFTraCosotbcZHUYaA1GF+Q7vWbXbX3Js2x
\r
31 92P19O73W+Z3UX+woE14p0zIADtJkpND+dXsPbPPqQ8ypahMbOEYJE88O6TrjuTLVDrp
\r
32 6cI6f/Ri5srRqcgu0wGONeko2WPilA7XKq5ZpyMHiuIiyfkGIDBl1C2jskJb6cfPnv4P
\r
33 fKgPpUjzm2wqrb5SltfqhDBVP1xoz+kmb71Yy7lMmPmzUPzvvFTBPKY+kBJTnVOk5AB6
\r
35 Received: by 10.180.95.1 with SMTP id dg1mr2681125wib.21.1332274328652;
\r
36 Tue, 20 Mar 2012 13:12:08 -0700 (PDT)
\r
37 Received: from localhost (94-192-233-223.zone6.bethere.co.uk.
\r
38 [94.192.233.223]) by mx.google.com with ESMTPS id
\r
39 k6sm36519566wie.9.2012.03.20.13.12.07 (version=TLSv1/SSLv3 cipher=OTHER);
\r
40 Tue, 20 Mar 2012 13:12:08 -0700 (PDT)
\r
41 From: Mark Walters <markwalters1009@gmail.com>
\r
42 To: notmuch@notmuchmail.org
\r
43 Subject: [WIP 2/2] cli: search: multithread
\r
44 Date: Tue, 20 Mar 2012 20:12:00 +0000
\r
45 Message-Id: <1332274320-17487-3-git-send-email-markwalters1009@gmail.com>
\r
46 X-Mailer: git-send-email 1.7.9.1
\r
47 In-Reply-To: <1332274320-17487-1-git-send-email-markwalters1009@gmail.com>
\r
48 References: <1332274320-17487-1-git-send-email-markwalters1009@gmail.com>
\r
49 X-BeenThere: notmuch@notmuchmail.org
\r
50 X-Mailman-Version: 2.1.13
\r
52 List-Id: "Use and development of the notmuch mail system."
\r
53 <notmuch.notmuchmail.org>
\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
57 List-Post: <mailto:notmuch@notmuchmail.org>
\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
60 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
61 X-List-Received-Date: Tue, 20 Mar 2012 20:12:18 -0000
\r
64 notmuch-search.c | 19 +++++++++++++++++++
\r
65 1 files changed, 19 insertions(+), 0 deletions(-)
\r
67 diff --git a/notmuch-search.c b/notmuch-search.c
\r
68 index f6061e4..2fa4231 100644
\r
69 --- a/notmuch-search.c
\r
70 +++ b/notmuch-search.c
\r
71 @@ -436,6 +436,9 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
73 int limit = -1; /* unlimited */
\r
74 notmuch_bool_t no_exclude = FALSE;
\r
75 + notmuch_bool_t secondary_search = FALSE;
\r
76 + char *secondary_search_terms = NULL;
\r
77 + notmuch_ss_conjunction_t ss_conjunction = NOTMUCH_SECONDARY_SEARCH_NONE;
\r
80 enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT }
\r
81 @@ -458,6 +461,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
82 { "tags", OUTPUT_TAGS },
\r
84 { NOTMUCH_OPT_BOOLEAN, &no_exclude, "no-exclude", 'd', 0 },
\r
85 + { NOTMUCH_OPT_BOOLEAN, &secondary_search, "secondary-search", 'd', 0 },
\r
86 { NOTMUCH_OPT_INT, &offset, "offset", 'O', 0 },
\r
87 { NOTMUCH_OPT_INT, &limit, "limit", 'L', 0 },
\r
89 @@ -478,6 +482,18 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
93 + if (secondary_search && argc-opt_index >= 2 ) {
\r
94 + if (strcmp (argv[argc - 2], ":AND:") == 0)
\r
95 + ss_conjunction = NOTMUCH_SECONDARY_SEARCH_AND;
\r
96 + if (strcmp (argv[argc - 2], ":AND_NOT:") == 0)
\r
97 + ss_conjunction = NOTMUCH_SECONDARY_SEARCH_AND_NOT;
\r
99 + if (ss_conjunction != NOTMUCH_SECONDARY_SEARCH_NONE) {
\r
100 + secondary_search_terms = argv[argc - 1];
\r
105 config = notmuch_config_open (ctx, NULL, NULL);
\r
106 if (config == NULL)
\r
108 @@ -505,6 +521,9 @@ notmuch_search_command (void *ctx, int argc, char *argv[])
\r
110 notmuch_query_set_sort (query, sort);
\r
112 + if (secondary_search_terms)
\r
113 + notmuch_query_set_secondary_search (query, secondary_search_terms, ss_conjunction);
\r
116 const char **search_exclude_tags;
\r
117 size_t search_exclude_tags_length;
\r