Announcing Astroid v0.6
[notmuch-archives.git] / d5 / d2a70f3f9c1d94dfa3a734bd99ecff6c7413f2
1 Return-Path: <aclements@csail.mit.edu>\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 6E559431FBF\r
6         for <notmuch@notmuchmail.org>; Sun, 12 Oct 2014 23:20:18 -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: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\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 Cz8pLV56TWLf for <notmuch@notmuchmail.org>;\r
16         Sun, 12 Oct 2014 23:20:11 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-5.mit.edu (dmz-mailsec-scanner-5.mit.edu\r
18         [18.7.68.34])\r
19         by olra.theworths.org (Postfix) with ESMTP id E0116431FAF\r
20         for <notmuch@notmuchmail.org>; Sun, 12 Oct 2014 23:20:10 -0700 (PDT)\r
21 X-AuditID: 12074422-f79436d000000c21-6d-543b6f1a72a1\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
23         (using TLS with cipher AES256-SHA (256/256 bits))\r
24         (Client did not present a certificate)\r
25         by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
26         id 08.FC.03105.A1F6B345; Mon, 13 Oct 2014 02:20:10 -0400 (EDT)\r
27 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
28         by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id s9D6K8Pb001787; \r
29         Mon, 13 Oct 2014 02:20:08 -0400\r
30 Received: from drake.dyndns.org ([73.162.189.21]) (authenticated bits=0)\r
31         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
32         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s9D6K524031970\r
33         (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT);\r
34         Mon, 13 Oct 2014 02:20:07 -0400\r
35 Received: from amthrax by drake.dyndns.org with local (Exim 4.84)\r
36         (envelope-from <aclements@csail.mit.edu>)\r
37         id 1XdYzF-0000UK-Be; Mon, 13 Oct 2014 02:20:05 -0400\r
38 From: Austin Clements <aclements@csail.mit.edu>\r
39 To: notmuch@notmuchmail.org\r
40 Subject: [WIP PATCH 4/4] lib: Add "lastmod:" queries for filtering by last\r
41         modification\r
42 Date: Mon, 13 Oct 2014 02:20:03 -0400\r
43 Message-Id: <1413181203-1676-5-git-send-email-aclements@csail.mit.edu>\r
44 X-Mailer: git-send-email 2.1.0\r
45 In-Reply-To: <1413181203-1676-1-git-send-email-aclements@csail.mit.edu>\r
46 References: <1413181203-1676-1-git-send-email-aclements@csail.mit.edu>\r
47 X-Brightmail-Tracker:\r
48  H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsUixG6noiuVbx1isP+9lMX1mzOZHRg9nq26\r
49         xRzAGMVlk5Kak1mWWqRvl8CVsXVhF1PBXumKC5cesDcwzhbvYuTkkBAwkdhxZTEjhC0mceHe\r
50         erYuRi4OIYHZTBITZr5mhXA2Mko0Xm1jh3CWM0msOfMJKrOEUeLixs9sIP1sAvoSK9ZOYgWx\r
51         RQSkJXbenQ1kc3AwC6hJ/OlSAQkLC4RL3Jk3gQnEZhFQlTi37ilYK6+Am8S2r3/YIM6Qk9iw\r
52         +z/YSZwC7hIXJ55lBrGFgGqOtV1jmcDIv4CRYRWjbEpulW5uYmZOcWqybnFyYl5eapGuqV5u\r
53         ZoleakrpJkZw2Lgo7WD8eVDpEKMAB6MSD6/FH6sQIdbEsuLK3EOMkhxMSqK8AWnWIUJ8Sfkp\r
54         lRmJxRnxRaU5qcWHGCU4mJVEeN/aAOV4UxIrq1KL8mFS0hwsSuK8m37whQgJpCeWpGanphak\r
55         FsFkZTg4lCR4V+QBNQoWpaanVqRl5pQgpJk4OEGG8wANXwRSw1tckJhbnJkOkT/FqCglzvs9\r
56         FyghAJLIKM2D64XF9StGcaBXhHnjQNp5gCkBrvsV0GAmoMFHu8xBBpckIqSkGhinL05mPHq3\r
57         9eiuj1uMVjG/1f3dajRhz/NDD1YplkYvPyGYraJXHrmLvXfrj5rl8+dxtm/Suayxge2Af39P\r
58         S3WpYqzsl6OZ/csC1iUJMJ5x2lYU+oHvi0hezmy1HUecvAU1XySu3nV50ocVlc9Xbdf4vH7p\r
59         o9/7H5Xt+LxkfUFcgqIt0ye+gEdtSizFGYmGWsxFxYkAgkepZ8YCAAA=\r
60 X-BeenThere: notmuch@notmuchmail.org\r
61 X-Mailman-Version: 2.1.13\r
62 Precedence: list\r
63 List-Id: "Use and development of the notmuch mail system."\r
64         <notmuch.notmuchmail.org>\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
66         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
68 List-Post: <mailto:notmuch@notmuchmail.org>\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
72 X-List-Received-Date: Mon, 13 Oct 2014 06:20:18 -0000\r
73 \r
74 From: Austin Clements <amdragon@mit.edu>\r
75 \r
76 XXX Includes reference to notmuch search --db-revision, which doesn't\r
77 exist.\r
78 ---\r
79  doc/man7/notmuch-search-terms.rst | 8 ++++++++\r
80  lib/database-private.h            | 1 +\r
81  lib/database.cc                   | 4 ++++\r
82  3 files changed, 13 insertions(+)\r
83 \r
84 diff --git a/doc/man7/notmuch-search-terms.rst b/doc/man7/notmuch-search-terms.rst\r
85 index 1acdaa0..df76e39 100644\r
86 --- a/doc/man7/notmuch-search-terms.rst\r
87 +++ b/doc/man7/notmuch-search-terms.rst\r
88 @@ -52,6 +52,8 @@ indicate user-supplied values):\r
89  \r
90  -  date:<since>..<until>\r
91  \r
92 +-  lastmod:<since>..<until>\r
93 +\r
94  The **from:** prefix is used to match the name or address of the sender\r
95  of an email message.\r
96  \r
97 @@ -118,6 +120,12 @@ The time range can also be specified using timestamps with a syntax of:\r
98  Each timestamp is a number representing the number of seconds since\r
99  1970-01-01 00:00:00 UTC.\r
100  \r
101 +The **lastmod:** prefix can be used to restrict the result by the\r
102 +database revision number of when messages were last modified (tags\r
103 +were added/removed or filenames changed).  This is usually used in\r
104 +conjunction with the **--db-revision** argument to **notmuch search**\r
105 +to find messages that have changed since an earlier query.\r
106 +\r
107  In addition to individual terms, multiple terms can be combined with\r
108  Boolean operators ( **and**, **or**, **not** , etc.). Each term in the\r
109  query will be implicitly connected by a logical AND if no explicit\r
110 diff --git a/lib/database-private.h b/lib/database-private.h\r
111 index 0977229..cbca1de 100644\r
112 --- a/lib/database-private.h\r
113 +++ b/lib/database-private.h\r
114 @@ -163,6 +163,7 @@ struct _notmuch_database {\r
115      Xapian::TermGenerator *term_gen;\r
116      Xapian::ValueRangeProcessor *value_range_processor;\r
117      Xapian::ValueRangeProcessor *date_range_processor;\r
118 +    Xapian::ValueRangeProcessor *last_mod_range_processor;\r
119  };\r
120  \r
121  /* Prior to database version 3, features were implied by the database\r
122 diff --git a/lib/database.cc b/lib/database.cc\r
123 index 9bec170..f9aa45d 100644\r
124 --- a/lib/database.cc\r
125 +++ b/lib/database.cc\r
126 @@ -913,6 +913,7 @@ notmuch_database_open (const char *path,\r
127         notmuch->term_gen->set_stemmer (Xapian::Stem ("english"));\r
128         notmuch->value_range_processor = new Xapian::NumberValueRangeProcessor (NOTMUCH_VALUE_TIMESTAMP);\r
129         notmuch->date_range_processor = new ParseTimeValueRangeProcessor (NOTMUCH_VALUE_TIMESTAMP);\r
130 +       notmuch->last_mod_range_processor = new Xapian::NumberValueRangeProcessor (NOTMUCH_VALUE_LAST_MOD, "lastmod:");\r
131  \r
132         notmuch->query_parser->set_default_op (Xapian::Query::OP_AND);\r
133         notmuch->query_parser->set_database (*notmuch->xapian_db);\r
134 @@ -920,6 +921,7 @@ notmuch_database_open (const char *path,\r
135         notmuch->query_parser->set_stemming_strategy (Xapian::QueryParser::STEM_SOME);\r
136         notmuch->query_parser->add_valuerangeprocessor (notmuch->value_range_processor);\r
137         notmuch->query_parser->add_valuerangeprocessor (notmuch->date_range_processor);\r
138 +       notmuch->query_parser->add_valuerangeprocessor (notmuch->last_mod_range_processor);\r
139  \r
140         for (i = 0; i < ARRAY_SIZE (BOOLEAN_PREFIX_EXTERNAL); i++) {\r
141             prefix_t *prefix = &BOOLEAN_PREFIX_EXTERNAL[i];\r
142 @@ -991,6 +993,8 @@ notmuch_database_close (notmuch_database_t *notmuch)\r
143      notmuch->value_range_processor = NULL;\r
144      delete notmuch->date_range_processor;\r
145      notmuch->date_range_processor = NULL;\r
146 +    delete notmuch->last_mod_range_processor;\r
147 +    notmuch->last_mod_range_processor = NULL;\r
148  \r
149      return status;\r
150  }\r
151 -- \r
152 2.1.0\r
153 \r