--- /dev/null
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id BCDB6429E25\r
+ for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 08:55:36 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id M6l9nxrmGNOd for <notmuch@notmuchmail.org>;\r
+ Sun, 23 Feb 2014 08:55:31 -0800 (PST)\r
+Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com\r
+ [209.85.215.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 1461B431FD6\r
+ for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 08:55:30 -0800 (PST)\r
+Received: by mail-ea0-f171.google.com with SMTP id f15so2614044eak.30\r
+ for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 08:55:29 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+ :references:in-reply-to:references;\r
+ bh=dx4WrF/ZtNCUFjz/4BqO7mkXMhuunVzf9KCaGKJINE0=;\r
+ b=ky43dG7bJdNZdspyGurjuD/lVLp5I08HrfhbHEwzjhSujmgKswrPFTwZXoh3vGSfcu\r
+ E0mRQRd6oysR/WrVPffa8Qn34xkIiZ9vAn5+EvZrqJyNODXt6n6JiTFWhd2FgcGmHEez\r
+ ud+4uP1+I0iMwaonRrXWhcgQlNti2SJV/7xceEAUKEu7+3yY1Y1enw7gtpf/1/huNSxE\r
+ 0NBntR7OD9vaz6XMY8XhEJunBsObaL3rfqobGRsGHgmCwTM48gF+dO5OEdDHD65LzOQm\r
+ 4FZf0Uv00vjURjI/DFAAFD5HQgl3tnwp9yFKCZf2BJ2qo3Mzl0QFmT0CAIARBNFpYEAZ\r
+ dbHw==\r
+X-Gm-Message-State:\r
+ ALoCoQlVcXkJTiJEWOj6mzEPYGKbyH6phwvmJRhN3ALcUYnLIpF67iXxPwUbM4VMk+Y0DUANcrMe\r
+X-Received: by 10.14.95.134 with SMTP id p6mr19825249eef.73.1393174529804;\r
+ Sun, 23 Feb 2014 08:55:29 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+ [88.195.111.91]) by mx.google.com with ESMTPSA id\r
+ j41sm53051047eey.15.2014.02.23.08.55.28 for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Sun, 23 Feb 2014 08:55:29 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org,\r
+ Rob Browning <rlb@defaultvalue.org>\r
+Subject: [PATCH 1/3] cli: export function for illegal tag checking\r
+Date: Sun, 23 Feb 2014 18:55:21 +0200\r
+Message-Id:\r
+ <9143b898e9112f07988c2db2d50a57f8638a3082.1393174108.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.8.5.3\r
+In-Reply-To: <cover.1393174108.git.jani@nikula.org>\r
+References: <87ha7qfto7.fsf@trouble.defaultvalue.org>\r
+ <cover.1393174108.git.jani@nikula.org>\r
+In-Reply-To: <cover.1393174108.git.jani@nikula.org>\r
+References: <cover.1393174108.git.jani@nikula.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\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: Sun, 23 Feb 2014 16:55:36 -0000\r
+\r
+This lets us check for forbidden tags consistently across the cli. No\r
+functional changes.\r
+---\r
+ tag-util.c | 9 +--------\r
+ tag-util.h | 12 ++++++++++++\r
+ 2 files changed, 13 insertions(+), 8 deletions(-)\r
+\r
+diff --git a/tag-util.c b/tag-util.c\r
+index 3bde4097372a..e2d5b795acc3 100644\r
+--- a/tag-util.c\r
++++ b/tag-util.c\r
+@@ -31,14 +31,7 @@ line_error (tag_parse_status_t status,\r
+ return status;\r
+ }\r
+ \r
+-/*\r
+- * Test tags for some forbidden cases.\r
+- *\r
+- * return: NULL if OK,\r
+- * explanatory message otherwise.\r
+- */\r
+-\r
+-static const char *\r
++const char *\r
+ illegal_tag (const char *tag, notmuch_bool_t remove)\r
+ {\r
+ \r
+diff --git a/tag-util.h b/tag-util.h\r
+index 4628f1630ad6..8a4074ce168f 100644\r
+--- a/tag-util.h\r
++++ b/tag-util.h\r
+@@ -90,6 +90,18 @@ parse_tag_command_line (void *ctx, int argc, char **argv,\r
+ char **query_str, tag_op_list_t *ops);\r
+ \r
+ /*\r
++ * Test tags for some forbidden cases.\r
++ *\r
++ * Relax the checks if 'remove' is true to allow removal of previously\r
++ * added forbidden tags.\r
++ *\r
++ * return: NULL if OK,\r
++ * explanatory message otherwise.\r
++ */\r
++const char *\r
++illegal_tag (const char *tag, notmuch_bool_t remove);\r
++\r
++/*\r
+ * Create an empty list of tag operations\r
+ *\r
+ * ctx is passed to talloc\r
+-- \r
+1.8.5.3\r
+\r