--- /dev/null
+Return-Path: <nex@nexoid.at>\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 98423431FD8\r
+ for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:35:11 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.001\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.001 tagged_above=-999 required=5\r
+ tests=[FREEMAIL_FROM=0.001] 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 iU2SmT3k+bbB for <notmuch@notmuchmail.org>;\r
+ Fri, 30 Nov 2012 00:35:11 -0800 (PST)\r
+Received: from mail.nexoid.at (www.nexoid.at [178.79.130.240])\r
+ (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 02721431FBC\r
+ for <notmuch@notmuchmail.org>; Fri, 30 Nov 2012 00:35:10 -0800 (PST)\r
+Received: by mail.nexoid.at (Postfix, from userid 1000)\r
+ id DB22C11C0D1; Fri, 30 Nov 2012 09:29:17 +0100 (CET)\r
+From: Peter Feigl <craven@gmx.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/3] Use the S-Expression structured printer for notmuch\r
+ search.\r
+Date: Fri, 30 Nov 2012 09:29:02 +0100\r
+Message-Id: <1354264143-30173-2-git-send-email-craven@gmx.net>\r
+X-Mailer: git-send-email 1.8.0\r
+In-Reply-To: <1354264143-30173-1-git-send-email-craven@gmx.net>\r
+References: <1354264143-30173-1-git-send-email-craven@gmx.net>\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: Fri, 30 Nov 2012 08:35:11 -0000\r
+\r
+This commit adds support for --format=sexp to notmuch search.\r
+---\r
+ notmuch-search.c | 6 +++++-\r
+ sprinter.h | 4 ++++\r
+ 2 files changed, 9 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/notmuch-search.c b/notmuch-search.c\r
+index 830c4e4..6218622 100644\r
+--- a/notmuch-search.c\r
++++ b/notmuch-search.c\r
+@@ -305,7 +305,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
+ int exclude = EXCLUDE_TRUE;\r
+ unsigned int i;\r
+ \r
+- enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT }\r
++ enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT, NOTMUCH_FORMAT_SEXP }\r
+ format_sel = NOTMUCH_FORMAT_TEXT;\r
+ \r
+ notmuch_opt_desc_t options[] = {\r
+@@ -315,6 +315,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
+ { 0, 0 } } },\r
+ { NOTMUCH_OPT_KEYWORD, &format_sel, "format", 'f',\r
+ (notmuch_keyword_t []){ { "json", NOTMUCH_FORMAT_JSON },\r
++ { "sexp", NOTMUCH_FORMAT_SEXP },\r
+ { "text", NOTMUCH_FORMAT_TEXT },\r
+ { 0, 0 } } },\r
+ { NOTMUCH_OPT_KEYWORD, &output, "output", 'o',\r
+@@ -347,6 +348,9 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
+ case NOTMUCH_FORMAT_JSON:\r
+ format = sprinter_json_create (ctx, stdout);\r
+ break;\r
++ case NOTMUCH_FORMAT_SEXP:\r
++ format = sprinter_sexp_create (ctx, stdout);\r
++ break;\r
+ default:\r
+ /* this should never happen */\r
+ INTERNAL_ERROR("no output format selected");\r
+diff --git a/sprinter.h b/sprinter.h\r
+index 912a526..59776a9 100644\r
+--- a/sprinter.h\r
++++ b/sprinter.h\r
+@@ -70,4 +70,8 @@ sprinter_text_create (const void *ctx, FILE *stream);\r
+ struct sprinter *\r
+ sprinter_json_create (const void *ctx, FILE *stream);\r
+ \r
++/* Create a new structure printer that emits S-Expressions. */\r
++struct sprinter *\r
++sprinter_sexp_create (const void *ctx, FILE *stream);\r
++\r
+ #endif // NOTMUCH_SPRINTER_H\r
+-- \r
+1.8.0\r
+\r