[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 2e / 7b683715e702a7a5d88b6b92418ba28ab78625
1 Return-Path: <five9a2@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 19FDC431FBF\r
6         for <notmuch@notmuchmail.org>; Mon, 23 Nov 2009 10:07:12 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id kWMPwgP64IOM for <notmuch@notmuchmail.org>;\r
11         Mon, 23 Nov 2009 10:07:11 -0800 (PST)\r
12 Received: from mail-bw0-f210.google.com (mail-bw0-f210.google.com\r
13         [209.85.218.210])\r
14         by olra.theworths.org (Postfix) with ESMTP id E73D7431FAE\r
15         for <notmuch@notmuchmail.org>; Mon, 23 Nov 2009 10:07:10 -0800 (PST)\r
16 Received: by bwz2 with SMTP id 2so5521364bwz.0\r
17         for <notmuch@notmuchmail.org>; Mon, 23 Nov 2009 10:07:10 -0800 (PST)\r
18 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
19         h=domainkey-signature:received:received:sender:from:to:cc:subject\r
20         :date:message-id:x-mailer:in-reply-to:references;\r
21         bh=wS1uR8Jzdr43cW2h/O5cK1D7IcDlwzYrpX1lxKOpacs=;\r
22         b=G14ZeXGQRamEZuTBuqLCDRbRaOBcdBXjewGh+oiXntOSsK3B4k/sVdl55Xa4jJGaVo\r
23         CZGbXFmACmLqLLTHkPy34SLE9i9g8flr61JLDYHqeRZjQhwuNWHTHQUjbZa/3SwmBGR5\r
24         2S3744/ux7TVms/qdXflBD9YpATa6MWIQW9q8=\r
25 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
26         h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
27         :references;\r
28         b=cQ3DRQouHVdr3lDoCP5pn6zQ3Tpd0enj3K0NWGiU4gGUl8x32XL+vJDIxkcsHVV0TM\r
29         HcoXdNl861xZhRn+ms4CY6Qwj1xrday9aP7UH9UinV2yzX9PJZTWD8vPm5+yiKvU+jpV\r
30         ZCsSulM+59hKdlqoNNfPfEk4kbX/fp4jo1ZHU=\r
31 Received: by 10.204.49.68 with SMTP id u4mr5108142bkf.42.1258999629698;\r
32         Mon, 23 Nov 2009 10:07:09 -0800 (PST)\r
33 Received: from localhost.localdomain (vawpc43.ethz.ch [129.132.59.11])\r
34         by mx.google.com with ESMTPS id 9sm6053600fks.52.2009.11.23.10.07.08\r
35         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
36         Mon, 23 Nov 2009 10:07:08 -0800 (PST)\r
37 Sender: Jed Brown <five9a2@gmail.com>\r
38 From: Jed Brown <jed@59A2.org>\r
39 To: notmuch@notmuchmail.org,\r
40         cworth@cworth.org\r
41 Date: Mon, 23 Nov 2009 19:07:23 +0100\r
42 Message-Id: <1258999643-30742-1-git-send-email-jed@59A2.org>\r
43 X-Mailer: git-send-email 1.6.5.3\r
44 In-Reply-To: <1258976966-22407-1-git-send-email-jed@59A2.org>\r
45 References: <1258976966-22407-1-git-send-email-jed@59A2.org>\r
46 Subject: [notmuch] [PATCH] Make search filters handle disjunctive queries.\r
47 X-BeenThere: notmuch@notmuchmail.org\r
48 X-Mailman-Version: 2.1.12\r
49 Precedence: list\r
50 List-Id: "Use and development of the notmuch mail system."\r
51         <notmuch.notmuchmail.org>\r
52 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
54 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
55 List-Post: <mailto:notmuch@notmuchmail.org>\r
56 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
57 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
58         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
59 X-List-Received-Date: Mon, 23 Nov 2009 18:07:12 -0000\r
60 \r
61 notmuch-search-filter accepts now accepts an arbitrary query and will\r
62 group if necessary so that we get\r
63 \r
64   tag:inbox AND (gravy OR biscuits)\r
65 \r
66 notmuch-search-filter-tag now handles multiple terms.  All terms in the\r
67 query except AND and OR are interpreted as tags.\r
68 \r
69 This version has nice regexes and handles NOT.\r
70 \r
71 Signed-off-by: Jed Brown <jed@59A2.org>\r
72 ---\r
73  notmuch.el |   27 ++++++++++++++++++++++-----\r
74  1 files changed, 22 insertions(+), 5 deletions(-)\r
75 \r
76 diff --git a/notmuch.el b/notmuch.el\r
77 index 0cabbe2..fdd30ae 100644\r
78 --- a/notmuch.el\r
79 +++ b/notmuch.el\r
80 @@ -828,6 +828,10 @@ thread from that buffer can be show when done with this one)."\r
81  (defvar notmuch-search-query-string)\r
82  (defvar notmuch-search-oldest-first)\r
83  \r
84 +(defvar notmuch-search-boolean-operator-regexp "\\([aA][nN][dD]\\|[oO][rR]\\|[nN][oO][tT]\\)")\r
85 +(defvar notmuch-search-valid-term-regexp       "\\([-+_.[:word:]]+\\)")\r
86 +(defvar notmuch-search-disjunctive-regexp      "\\<[oO][rR]\\>")\r
87 +\r
88  (defun notmuch-search-scroll-up ()\r
89    "Scroll up, moving point to last message in thread if at end."\r
90    (interactive)\r
91 @@ -1057,15 +1061,28 @@ search."\r
92  Runs a new search matching only messages that match both the\r
93  current search results AND the additional query string provided."\r
94    (interactive "sFilter search: ")\r
95 -  (notmuch-search (concat notmuch-search-query-string " and " query) notmuch-search-oldest-first))\r
96 +  (let ((grouped-query (if (string-match-p notmuch-search-disjunctive-regexp query) (concat "( " query " )") query)))\r
97 +    (notmuch-search (concat notmuch-search-query-string " and " grouped-query) notmuch-search-oldest-first)))\r
98  \r
99 -(defun notmuch-search-filter-by-tag (tag)\r
100 -  "Filter the current search results based on a single tag.\r
101 +(defun notmuch-search-filter-by-tag (query)\r
102 +  "Filter the current search results based on one or more tags.\r
103  \r
104  Runs a new search matching only messages that match both the\r
105 -current search results AND that are tagged with the given tag."\r
106 +current search results AND that are tagged with the given\r
107 +expression involving tags.  For example, the input\r
108 +\r
109 +  chicken and (gravy or biscuits)\r
110 +\r
111 +will filter the current search by\r
112 +\r
113 +  tag:chicken and ( tag:gravy or tag:biscuits )"\r
114    (interactive "sFilter by tag: ")\r
115 -  (notmuch-search (concat notmuch-search-query-string " and tag:" tag) notmuch-search-oldest-first))\r
116 +  (let ((tagged-query (replace-regexp-in-string notmuch-search-valid-term-regexp\r
117 +                                               (lambda (match) ; Prepend `tag:' to all except boolean operators\r
118 +                                                 (if (string-match-p notmuch-search-boolean-operator-regexp match)\r
119 +                                                     match (concat "tag:" match)))\r
120 +                                               query)))\r
121 +    (notmuch-search-filter tagged-query)))\r
122  \r
123  (defun notmuch ()\r
124    "Run notmuch to display all mail with tag of 'inbox'"\r
125 -- \r
126 1.6.5.3\r
127 \r