--- /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 3A1836DE1648\r
+ for <notmuch@notmuchmail.org>; Wed, 23 Sep 2015 05:00:27 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.113\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.113 tagged_above=-999 required=5 tests=[AWL=0.113]\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 tz5cnjo6HyLx for <notmuch@notmuchmail.org>;\r
+ Wed, 23 Sep 2015 05:00:25 -0700 (PDT)\r
+Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 2B4FC6DE1603\r
+ for <notmuch@notmuchmail.org>; Wed, 23 Sep 2015 05:00:25 -0700 (PDT)\r
+Received: from remotemail by gitolite.debian.net with local (Exim 4.80)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1Zeii6-0001x2-Pv; Wed, 23 Sep 2015 11:59:42 +0000\r
+Received: (nullmailer pid 26809 invoked by uid 1000); Wed, 23 Sep 2015\r
+ 11:59:23 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] lib: constify arguments to notmuch_query_get_*\r
+Date: Wed, 23 Sep 2015 08:59:14 -0300\r
+Message-Id: <1443009554-26766-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.5.1\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 23 Sep 2015 12:00:27 -0000\r
+\r
+These functions are all just accessors, and it's pretty clear they don't\r
+modify the query struct. This also fixes one warning I created when I\r
+introduced status.c.\r
+---\r
+ lib/notmuch.h | 6 +++---\r
+ lib/query.cc | 6 +++---\r
+ 2 files changed, 6 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/lib/notmuch.h b/lib/notmuch.h\r
+index 86b5b4d..8775683 100644\r
+--- a/lib/notmuch.h\r
++++ b/lib/notmuch.h\r
+@@ -728,13 +728,13 @@ typedef enum {\r
+ * Return the query_string of this query. See notmuch_query_create.\r
+ */\r
+ const char *\r
+-notmuch_query_get_query_string (notmuch_query_t *query);\r
++notmuch_query_get_query_string (const notmuch_query_t *query);\r
+ \r
+ /**\r
+ * Return the notmuch database of this query. See notmuch_query_create.\r
+ */\r
+ notmuch_database_t *\r
+-notmuch_query_get_database (notmuch_query_t *query);\r
++notmuch_query_get_database (const notmuch_query_t *query);\r
+ \r
+ /**\r
+ * Exclude values for notmuch_query_set_omit_excluded. The strange\r
+@@ -791,7 +791,7 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort);\r
+ * notmuch_query_set_sort.\r
+ */\r
+ notmuch_sort_t\r
+-notmuch_query_get_sort (notmuch_query_t *query);\r
++notmuch_query_get_sort (const notmuch_query_t *query);\r
+ \r
+ /**\r
+ * Add a tag that will be excluded from the query results by default.\r
+diff --git a/lib/query.cc b/lib/query.cc\r
+index f53215d..8cf0a07 100644\r
+--- a/lib/query.cc\r
++++ b/lib/query.cc\r
+@@ -98,7 +98,7 @@ notmuch_query_create (notmuch_database_t *notmuch,\r
+ }\r
+ \r
+ const char *\r
+-notmuch_query_get_query_string (notmuch_query_t *query)\r
++notmuch_query_get_query_string (const notmuch_query_t *query)\r
+ {\r
+ return query->query_string;\r
+ }\r
+@@ -117,7 +117,7 @@ notmuch_query_set_sort (notmuch_query_t *query, notmuch_sort_t sort)\r
+ }\r
+ \r
+ notmuch_sort_t\r
+-notmuch_query_get_sort (notmuch_query_t *query)\r
++notmuch_query_get_sort (const notmuch_query_t *query)\r
+ {\r
+ return query->sort;\r
+ }\r
+@@ -660,7 +660,7 @@ notmuch_query_count_threads (notmuch_query_t *query)\r
+ }\r
+ \r
+ notmuch_database_t *\r
+-notmuch_query_get_database (notmuch_query_t *query)\r
++notmuch_query_get_database (const notmuch_query_t *query)\r
+ {\r
+ return query->notmuch;\r
+ }\r
+-- \r
+2.5.1\r
+\r