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