--- /dev/null
+Return-Path: <bremner@tesseract.cs.unb.ca>\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 47AC26DE02D9\r
+ for <notmuch@notmuchmail.org>; Sat, 26 Mar 2016 11:24:37 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.02\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.021,\r
+ HEADER_FROM_DIFFERENT_DOMAINS=0.001] 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 lbk4zdSXNs8Z for <notmuch@notmuchmail.org>;\r
+ Sat, 26 Mar 2016 11:24:29 -0700 (PDT)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 48C016DE02A9\r
+ for <notmuch@notmuchmail.org>; Sat, 26 Mar 2016 11:23:25 -0700 (PDT)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <bremner@tesseract.cs.unb.ca>)\r
+ id 1ajsTX-0000vP-8b; Sat, 26 Mar 2016 13:58:15 -0400\r
+Received: (nullmailer pid 8826 invoked by uid 1000);\r
+ Sat, 26 Mar 2016 17:57:27 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Patch v2 12/13] lib: make a global constant for query parser flags\r
+Date: Sat, 26 Mar 2016 14:57:22 -0300\r
+Message-Id: <1459015043-8460-13-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.6.4\r
+In-Reply-To: <1459015043-8460-1-git-send-email-david@tethera.net>\r
+References: <1459015043-8460-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: Sat, 26 Mar 2016 18:24:37 -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 e627bfc..972a389 100644\r
+--- a/lib/query.cc\r
++++ b/lib/query.cc\r
+@@ -212,12 +212,6 @@ notmuch_query_search_messages_st (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
+@@ -225,7 +219,7 @@ notmuch_query_search_messages_st (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
+@@ -565,12 +559,6 @@ notmuch_query_count_messages_st (notmuch_query_t *query, unsigned *count_out)\r
+ "mail"));\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
+@@ -578,7 +566,7 @@ notmuch_query_count_messages_st (notmuch_query_t *query, unsigned *count_out)\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.6.4\r
+\r