--- /dev/null
+Return-Path: <amdragon@mit.edu>\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 D2F0F431FB6\r
+ for <notmuch@notmuchmail.org>; Fri, 13 Jul 2012 18:46:33 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\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 MxJB49XwDqnA for <notmuch@notmuchmail.org>;\r
+ Fri, 13 Jul 2012 18:46:33 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU\r
+ [18.9.25.13])\r
+ by olra.theworths.org (Postfix) with ESMTP id D4B58431FAE\r
+ for <notmuch@notmuchmail.org>; Fri, 13 Jul 2012 18:46:32 -0700 (PDT)\r
+X-AuditID: 1209190d-b7fd56d000000933-f4-5000cf77a7e0\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+ by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id 4C.B7.02355.77FC0005; Fri, 13 Jul 2012 21:46:31 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q6E1kUSS006235; \r
+ Fri, 13 Jul 2012 21:46:31 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+ (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6E1kTIw007839\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Fri, 13 Jul 2012 21:46:30 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1SprRF-0000cE-DJ; Fri, 13 Jul 2012 21:46:29 -0400\r
+Date: Fri, 13 Jul 2012 21:46:29 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Peter Feigl <craven@gmx.net>\r
+Subject: Re: [PATCH v5 1/3] Add support for structured output formatters.\r
+Message-ID: <20120714014629.GB31670@mit.edu>\r
+References: <20120710191331.GE7332@mit.edu>\r
+ <1342167097-25012-1-git-send-email-craven@gmx.net>\r
+ <1342167097-25012-2-git-send-email-craven@gmx.net>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1342167097-25012-2-git-send-email-craven@gmx.net>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFmphleLIzCtJLcpLzFFi42IRYrdT0S0/zxBg8PKlgsXehnZGi+s3ZzI7\r
+ MHks3rSfzePZqlvMAUxRXDYpqTmZZalF+nYJXBk7D69lLniqUbFgzmG2BsYH8l2MnBwSAiYS\r
+ m280skPYYhIX7q1n62Lk4hAS2McocXjNS7CEkMAGRomJ74shEieZJObefcEM4SxhlHh29jZY\r
+ FYuAqkRXYwsriM0moCGxbf9yRhBbREBB4tm6JjCbWUBa4tvvZiYQW1jAU2Lv3e1sIDavgI5E\r
+ y5XprBBDpzJKzH97khUiIShxcuYTFohmLYkb/14CNXOADVr+jwMkzClgL/H82zFmEFtUQEVi\r
+ ysltbBMYhWYh6Z6FpHsWQvcCRuZVjLIpuVW6uYmZOcWpybrFyYl5ealFukZ6uZkleqkppZsY\r
+ QYHNKcm7g/HdQaVDjAIcjEo8vKn+DAFCrIllxZW5hxglOZiURHlrjwOF+JLyUyozEosz4otK\r
+ c1KLDzFKcDArifCatwHleFMSK6tSi/JhUtIcLErivFdSbvoLCaQnlqRmp6YWpBbBZGU4OJQk\r
+ eE+fA2oULEpNT61Iy8wpQUgzcXCCDOcBGv4QpIa3uCAxtzgzHSJ/ilFRSpz3LUhCACSRUZoH\r
+ 1wtLPK8YxYFeEeb9BVLFA0xacN2vgAYzAQ2e9fOfP9DgkkSElFQD4/ZFzH9eP5t19mR9dLyR\r
+ 97T9FzyZbm3JP71eYf+BiD3nj8ZErnis6mw3VW02V+HcZTEMX24Vr+b76WN0YM2Smf/vT7g/\r
+ 42hiwlGn0Bk7dnPLRdqJ3FHs32OdzKzscVhMYuuThmKdiww9/M4W+n7ZdndTozjDO456Jb2a\r
+ u3zr9zcp+j0TAn/wPlZiKc5INNRiLipOBACWAzoyFwMAAA==\r
+Cc: notmuch@notmuchmail.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: Sat, 14 Jul 2012 01:46:34 -0000\r
+\r
+Quoth Peter Feigl on Jul 13 at 10:11 am:\r
+> From: <craven@gmx.net>\r
+> \r
+> This patch adds a new type sprinter_t, which is used for structured\r
+> formatting, e.g. JSON or S-Expressions. The structure printer is the\r
+> code from Austin Clements (id:87d34hsdx8.fsf@awakening.csail.mit.edu)\r
+> with minor modifications.\r
+> \r
+> The structure printer contains the following function pointers:\r
+> \r
+> /* Start a new map/dictionary structure. This should be followed by\r
+> * a sequence of alternating calls to map_key and one of the\r
+> * value-printing functions until the map is ended by end.\r
+> */\r
+> void (*begin_map)(struct sprinter *);\r
+> \r
+> /* Start a new list/array structure.\r
+> */\r
+> void (*begin_list)(struct sprinter *);\r
+> \r
+> /* End the last opened list or map structure.\r
+> */\r
+> void (*end)(struct sprinter *);\r
+> \r
+> /* Set the prefix of the next component. This is purely for\r
+> * debugging purposes and for the unstructured text formatter.\r
+> */\r
+> void (*set_prefix)(struct sprinter *, const char *);\r
+> \r
+> /* Print one string/integer/boolean/null element (possibly inside a\r
+> * list or map, followed or preceded by separators).\r
+> * For string, the char * must be UTF-8 encoded.\r
+> */\r
+> void (*string)(struct sprinter *, const char *);\r
+> void (*integer)(struct sprinter *, int);\r
+> void (*boolean)(struct sprinter *, notmuch_bool_t);\r
+> void (*null)(struct sprinter *);\r
+> \r
+> /* Print the key of a map's key/value pair. The char * must be UTF-8\r
+> * encoded.\r
+> */\r
+> void (*map_key)(struct sprinter *, const char *);\r
+> \r
+> /* Insert a separator (usually extra whitespace) for improved\r
+> * readability without affecting the abstract syntax of the\r
+> * structure being printed.\r
+> * For JSON, this could simply be a line break.\r
+> */\r
+> void (*separator)(struct sprinter *);\r
+> \r
+> The printer can (and should) use internal state to insert delimiters and\r
+> syntax at the correct places.\r
+> \r
+> Example:\r
+> \r
+> format->begin_map(format);\r
+> format->map_key(format, "foo");\r
+> format->begin_list(format);\r
+> format->integer(format, 1);\r
+> format->integer(format, 2);\r
+> format->integer(format, 3);\r
+> format->end(format);\r
+> format->map_key(format, "bar");\r
+> format->begin_map(format);\r
+> format->map_key(format, "baaz");\r
+> format->string(format, "hello world");\r
+> format->end(format);\r
+> format->end(format);\r
+> \r
+> would output JSON as follows:\r
+> \r
+> {"foo": [1, 2, 3], "bar": { "baaz": "hello world"}}\r
+> ---\r
+> sprinter.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++\r
+> 1 file changed, 50 insertions(+)\r
+> create mode 100644 sprinter.h\r
+> \r
+> diff --git a/sprinter.h b/sprinter.h\r
+> new file mode 100644\r
+> index 0000000..c9cd6a6\r
+> --- /dev/null\r
+> +++ b/sprinter.h\r
+> @@ -0,0 +1,50 @@\r
+> +#ifndef NOTMUCH_SPRINTER_H\r
+> +#define NOTMUCH_SPRINTER_H\r
+> +\r
+> +/* Necessary for notmuch_bool_t */\r
+> +#include "notmuch-client.h"\r
+> +\r
+> +/* Structure printer interface */\r
+> +typedef struct sprinter {\r
+> + /* Start a new map/dictionary structure. This should be followed by\r
+> + * a sequence of alternating calls to map_key and one of the\r
+> + * value-printing functions until the map is ended by end.\r
+> + */\r
+> + void (*begin_map)(struct sprinter *);\r
+\r
+It looks like you lost the spaces before the argument lists, which\r
+your previous version had. Was this from uncrustify? The few other\r
+places that notmuch had function pointers do put a space here.\r
+\r
+> +\r
+> + /* Start a new list/array structure.\r
+> + */\r
+> + void (*begin_list)(struct sprinter *);\r
+> +\r
+> + /* End the last opened list or map structure.\r
+> + */\r
+> + void (*end)(struct sprinter *);\r
+> +\r
+> + /* Set the prefix of the next component. This is purely for\r
+> + * debugging purposes and for the unstructured text formatter.\r
+\r
+This should probably be more specific about what this operation does\r
+and under what circumstances. It also makes it sound like it only\r
+applies to the next component, which I think is not the case. Maybe\r
+\r
+/* Set the current string prefix. This only affects the text\r
+ * printer, which will print this string, followed by a colon, before\r
+ * any string. For other printers, this does nothing.\r
+ */\r
+\r
+?\r
+\r
+> + */\r
+> + void (*set_prefix)(struct sprinter *, const char *);\r
+> +\r
+> + /* Print one string/integer/boolean/null element (possibly inside a\r
+> + * list or map, followed or preceded by separators).\r
+> + * For string, the char * must be UTF-8 encoded.\r
+> + */\r
+> + void (*string)(struct sprinter *, const char *);\r
+> + void (*integer)(struct sprinter *, int);\r
+> + void (*boolean)(struct sprinter *, notmuch_bool_t);\r
+> + void (*null)(struct sprinter *);\r
+> +\r
+> + /* Print the key of a map's key/value pair. The char * must be UTF-8\r
+> + * encoded.\r
+> + */\r
+> + void (*map_key)(struct sprinter *, const char *);\r
+> +\r
+> + /* Insert a separator (usually extra whitespace) for improved\r
+> + * readability without affecting the abstract syntax of the\r
+> + * structure being printed.\r
+> + * For JSON, this could simply be a line break.\r
+> + */\r
+> + void (*separator)(struct sprinter *);\r
+> +} sprinter_t;\r
+> +\r
+> +#endif // NOTMUCH_SPRINTER_H\r