--- /dev/null
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 4C80F6DE094A\r
+ for <notmuch@notmuchmail.org>; Sat, 30 Apr 2016 18:25:27 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.015\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.015 tagged_above=-999 required=5\r
+ tests=[AWL=-0.004, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id KXhKCW3fgbUG for <notmuch@notmuchmail.org>;\r
+ Sat, 30 Apr 2016 18:25:19 -0700 (PDT)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 482546DE0360\r
+ for <notmuch@notmuchmail.org>; Sat, 30 Apr 2016 18:24:54 -0700 (PDT)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1awg7t-0006cd-9W; Sat, 30 Apr 2016 21:24:49 -0400\r
+Received: (nullmailer pid 29959 invoked by uid 1000);\r
+ Sun, 01 May 2016 01:24:43 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Patch v3 10/11] lib: make a global constant for query parser flags\r
+Date: Sat, 30 Apr 2016 22:24:38 -0300\r
+Message-Id: <1462065879-29860-11-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.8.0.rc3\r
+In-Reply-To: <1462065879-29860-1-git-send-email-david@tethera.net>\r
+References: <1462065879-29860-1-git-send-email-david@tethera.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 01 May 2016 01:25:27 -0000\r
+\r
+It's already kindof gross that this is hardcoded in two different\r
+places. We will also need these later in field processors calling back\r
+into the query parser.\r
+---\r
+ lib/database-private.h | 4 ++++\r
+ lib/query.cc | 16 ++--------------\r
+ 2 files changed, 6 insertions(+), 14 deletions(-)\r
+\r
+diff --git a/lib/database-private.h b/lib/database-private.h\r
+index e1962f4..b5c1f90 100644\r
+--- a/lib/database-private.h\r
++++ b/lib/database-private.h\r
+@@ -144,6 +144,10 @@ operator&=(_notmuch_features &a, _notmuch_features b)\r
+ return a;\r
+ }\r
+ \r
++#define NOTMUCH_QUERY_PARSER_FLAGS (Xapian::QueryParser::FLAG_BOOLEAN | Xapian::QueryParser::FLAG_PHRASE | \\r
++ Xapian::QueryParser::FLAG_LOVEHATE | Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE | \\r
++ Xapian::QueryParser::FLAG_WILDCARD | Xapian::QueryParser::FLAG_PURE_NOT)\r
++\r
+ struct _notmuch_database {\r
+ notmuch_bool_t exception_reported;\r
+ \r
+diff --git a/lib/query.cc b/lib/query.cc\r
+index 77a7926..0875b0e 100644\r
+--- a/lib/query.cc\r
++++ b/lib/query.cc\r
+@@ -220,12 +220,6 @@ _notmuch_query_search_documents (notmuch_query_t *query,\r
+ Xapian::Query string_query, final_query, exclude_query;\r
+ Xapian::MSet mset;\r
+ Xapian::MSetIterator iterator;\r
+- unsigned int flags = (Xapian::QueryParser::FLAG_BOOLEAN |\r
+- Xapian::QueryParser::FLAG_PHRASE |\r
+- Xapian::QueryParser::FLAG_LOVEHATE |\r
+- Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE |\r
+- Xapian::QueryParser::FLAG_WILDCARD |\r
+- Xapian::QueryParser::FLAG_PURE_NOT);\r
+ \r
+ if (strcmp (query_string, "") == 0 ||\r
+ strcmp (query_string, "*") == 0)\r
+@@ -233,7 +227,7 @@ _notmuch_query_search_documents (notmuch_query_t *query,\r
+ final_query = mail_query;\r
+ } else {\r
+ string_query = notmuch->query_parser->\r
+- parse_query (query_string, flags);\r
++ parse_query (query_string, NOTMUCH_QUERY_PARSER_FLAGS);\r
+ final_query = Xapian::Query (Xapian::Query::OP_AND,\r
+ mail_query, string_query);\r
+ }\r
+@@ -579,12 +573,6 @@ _notmuch_query_count_documents (notmuch_query_t *query, const char *type, unsign\r
+ type));\r
+ Xapian::Query string_query, final_query, exclude_query;\r
+ Xapian::MSet mset;\r
+- unsigned int flags = (Xapian::QueryParser::FLAG_BOOLEAN |\r
+- Xapian::QueryParser::FLAG_PHRASE |\r
+- Xapian::QueryParser::FLAG_LOVEHATE |\r
+- Xapian::QueryParser::FLAG_BOOLEAN_ANY_CASE |\r
+- Xapian::QueryParser::FLAG_WILDCARD |\r
+- Xapian::QueryParser::FLAG_PURE_NOT);\r
+ \r
+ if (strcmp (query_string, "") == 0 ||\r
+ strcmp (query_string, "*") == 0)\r
+@@ -592,7 +580,7 @@ _notmuch_query_count_documents (notmuch_query_t *query, const char *type, unsign\r
+ final_query = mail_query;\r
+ } else {\r
+ string_query = notmuch->query_parser->\r
+- parse_query (query_string, flags);\r
++ parse_query (query_string, NOTMUCH_QUERY_PARSER_FLAGS);\r
+ final_query = Xapian::Query (Xapian::Query::OP_AND,\r
+ mail_query, string_query);\r
+ }\r
+-- \r
+2.8.0.rc3\r
+\r