Re: [PATCH 1/3] Adding an S-expression structured output printer.
authorAustin Clements <amdragon@MIT.EDU>
Sat, 1 Dec 2012 15:18:17 +0000 (10:18 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:51:16 +0000 (09:51 -0800)
93/8c768deb17874e5630cd0fa914bebebc67d685 [new file with mode: 0644]

diff --git a/93/8c768deb17874e5630cd0fa914bebebc67d685 b/93/8c768deb17874e5630cd0fa914bebebc67d685
new file mode 100644 (file)
index 0000000..b9fbf3a
--- /dev/null
@@ -0,0 +1,118 @@
+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 5964F431FAF\r
+       for <notmuch@notmuchmail.org>; Sat,  1 Dec 2012 07:18:29 -0800 (PST)\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 KgWKhesRFv4p for <notmuch@notmuchmail.org>;\r
+       Sat,  1 Dec 2012 07:18:25 -0800 (PST)\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 884CD431FBC\r
+       for <notmuch@notmuchmail.org>; Sat,  1 Dec 2012 07:18:25 -0800 (PST)\r
+X-AuditID: 1209190d-b7f266d00000092b-bd-50ba1fc0939e\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 25.4C.02347.0CF1AB05; Sat,  1 Dec 2012 10:18:24 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id qB1FINRe003539; \r
+       Sat, 1 Dec 2012 10:18:23 -0500\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 qB1FIHOm026728\r
+       (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+       Sat, 1 Dec 2012 10:18:18 -0500 (EST)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1Teopd-0005IR-9u; Sat, 01 Dec 2012 10:18:17 -0500\r
+Date: Sat, 1 Dec 2012 10:18:17 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>\r
+Subject: Re: [PATCH 1/3] Adding an S-expression structured output printer.\r
+Message-ID: <20121201151817.GF4681@mit.edu>\r
+References: <1354264143-30173-1-git-send-email-craven@gmx.net>\r
+       <871ufa9jpm.fsf@qmul.ac.uk> <m2txs6vwdy.fsf@guru.guru-group.fi>\r
+       <87d2yu559y.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <87d2yu559y.fsf@qmul.ac.uk>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFlrAKsWRmVeSWpSXmKPExsUixG6nrntAfleAwfOnHBZ7G9oZLVbP5bG4\r
+       fnMms8WblfNYHVg8ds66y+6xeNN+No/DXxeyeDxbdYs5gCWKyyYlNSezLLVI3y6BK+Pv/F1M\r
+       BT94K26928/awPiRq4uRk0NCwETi7Y0djBC2mMSFe+vZQGwhgX2MEseOGHcxcgHZ6xkl+v+f\r
+       Y4NwLjBJLD62lxHCWcIocXLmTrAWFgEVibmzlrOD2GwCGhLb9i8HGysioCNx+9ACsDizQIrE\r
+       j1X3wOqFBbwkPv25ztTFyMHBK6AtMXN5MsTmBYwSE49Zgdi8AoJA45+wQLRqSdz49xKsnFlA\r
+       WmL5Pw4QkxNo08I52SAVokAHTDm5jW0Co9AsJM2zkDTPQmhewMi8ilE2JbdKNzcxM6c4NVm3\r
+       ODkxLy+1SNdILzezRC81pXQTIyjwOSV5dzC+O6h0iFGAg1GJh3fH4x0BQqyJZcWVuYcYJTmY\r
+       lER518juChDiS8pPqcxILM6ILyrNSS0+xCjBwawkwnv03s4AId6UxMqq1KJ8mJQ0B4uSOO+V\r
+       lJv+QgLpiSWp2ampBalFMFkZDg4lCd5QYIQLCRalpqdWpGXmlCCkmTg4QYbzAA1PAqnhLS5I\r
+       zC3OTIfIn2LU5Zgzs/0JoxBLXn5eqpQ4bzhIkQBIUUZpHtwcWMJ6xSgO9JYwrx5IFQ8w2cFN\r
+       egW0hAloyZtl20GWlCQipKQaGDtUa3gvf3naOTOyNOZ70KxJ/3dOW8D7L9au47/c+xUci07e\r
+       3Nn/SMHl3LMArifT5j38MOM0f4vm1qmKW7fnHpl84Kone+EEy2Nnyhucn1UxBfOWLroU4L7H\r
+       //WVa0uZVNx1spb9a5MPvhf//dlc1VUGU42PBd3eOyeqJSR53uQt4g2Oq6cJWBoosRRnJBpq\r
+       MRcVJwIAzLJ/qjMDAAA=\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>, 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, 01 Dec 2012 15:18:29 -0000\r
+\r
+Quoth Mark Walters on Dec 01 at 12:24 pm:\r
+> \r
+> On Sat, 01 Dec 2012, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+> > On Sat, Dec 01 2012, Mark Walters wrote:\r
+> >\r
+> >> Hi\r
+> >>\r
+> >> Overall I like the series: I think I agree with all of Jani's\r
+> >> comments. \r
+> >>\r
+> >> My one extra comment is that I think we should decide on whether we also\r
+> >> want a sexp plist version. I think we might want one for the emacs\r
+> >> front-end as that currently uses plists for everything.\r
+> >>\r
+> >> If we do we might want to change the names a little, both for functions\r
+> >> and options (eg sexp_a and sexp_p or something). Probably a lot of\r
+> >> sprinter-sexp would be common to both versions.\r
+> >\r
+> > This is an important question that needs to be addressed fast: options\r
+> > are:\r
+> >\r
+> > 1) have options to spit both alist & plist formats\r
+> > 2) when converting emacs to use s-expressions, convert it to use alists\r
+> > 3) start using plists instead of alists in Peter's android client\r
+> \r
+> Ok I have looked at this and the changes needed to output plist (or\r
+> both) are pretty small: the only functions from sprinter-sexp.c that\r
+> need to be changed are sexp_end and sexp_map_key. The total diff from\r
+> alist to plist is about 10 lines. I have a version which allows both\r
+> (the same sprinter file creates both possibilities) and have hooked it\r
+> into emacs/notmuch-show.el and it all seems to work. \r
+> \r
+> (Search is more difficult as that uses the async parser; indeed even for\r
+> show I used sexp-at-point as suggested by Tomi which seems rather\r
+> underdocumented but does seem to work)\r
+\r
+I'm happy to write an async sexp parser.  I specifically designed the\r
+async JSON parser with later switching to sexps in mind, so I already\r
+have a plan for how to do this.\r