Re: [PATCH] rewriting notmuch-search for structured output to make other output forma...
authorPeter Feigl <craven@gmx.net>
Sat, 21 Jan 2012 23:21:37 +0000 (00:21 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:42:53 +0000 (09:42 -0800)
b4/d9c3a7768ef08ea107408894e6c6a634287d56 [new file with mode: 0644]

diff --git a/b4/d9c3a7768ef08ea107408894e6c6a634287d56 b/b4/d9c3a7768ef08ea107408894e6c6a634287d56
new file mode 100644 (file)
index 0000000..03d0c82
--- /dev/null
@@ -0,0 +1,95 @@
+Return-Path: <craven@gmx.net>\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 3B33E429E40\r
+       for <notmuch@notmuchmail.org>; Sat, 21 Jan 2012 15:21:40 -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, RCVD_IN_DNSWL_NONE=-0.0001]\r
+       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 MzB9rJSuimGD for <notmuch@notmuchmail.org>;\r
+       Sat, 21 Jan 2012 15:21:39 -0800 (PST)\r
+Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23])\r
+       by olra.theworths.org (Postfix) with SMTP id 53454431FAF\r
+       for <notmuch@notmuchmail.org>; Sat, 21 Jan 2012 15:21:39 -0800 (PST)\r
+Received: (qmail invoked by alias); 21 Jan 2012 23:21:38 -0000\r
+Received: from www.nexoid.at (EHLO mail.nexoid.at) [178.79.130.240]\r
+       by mail.gmx.net (mp063) with SMTP; 22 Jan 2012 00:21:38 +0100\r
+X-Authenticated: #201305\r
+X-Provags-ID: V01U2FsdGVkX18HvhdUyeMHBoC6C3xaSRUeScItUw9hq8q0tWB09i\r
+       EegPSslarHYe1z\r
+Received: by mail.nexoid.at (Postfix, from userid 1000)\r
+       id 927FA57019; Sun, 22 Jan 2012 00:21:37 +0100 (CET)\r
+From: "Peter Feigl" <craven@gmx.net>\r
+To: Jameson Graef Rollins <jrollins@finestructure.net>\r
+Subject: Re: [PATCH] rewriting notmuch-search for structured output to make\r
+       other output formats easier\r
+In-Reply-To: <87k44klkee.fsf@servo.finestructure.net>\r
+References: <1327180568-30385-1-git-send-email-craven@gmx.net>\r
+       <87k44klkee.fsf@servo.finestructure.net>\r
+User-Agent: Notmuch/0.11+77~gad6d0d5 (http://notmuchmail.org) Emacs/23.3.1\r
+       (i686-pc-linux-gnu)\r
+Date: Sun, 22 Jan 2012 00:21:37 +0100\r
+Message-ID: <87lip0ljzy.fsf@nexoid.at>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Y-GMX-Trusted: 0\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, 21 Jan 2012 23:21:40 -0000\r
+\r
+On Sat, 21 Jan 2012 15:12:57 -0800, Jameson Graef Rollins <jrollins@finestructure.net> wrote:\r
+> On Sat, 21 Jan 2012 22:16:08 +0100, Peter Feigl <craven@gmx.net> wrote:\r
+> > The output routines have been rewritten so that logical structure\r
+> > (objects with key/value pairs, arrays, strings and numbers) are\r
+> > written instead of ad-hoc printfs. This allows for easier adaptation\r
+> > of other output formats, as only the routines that start/end an object\r
+> > etc. have to be rewritten. The logic is the same for all formats.\r
+> > The default text output is handled differently, special cases are\r
+> > inserted at the proper places, as it differs too much from the\r
+> > structured output.\r
+> \r
+> Hi, Peter.  Thanks for the contribution.\r
+> \r
+> There are a lot of changes in this patch so I think you need to think\r
+> about how you can break this up into multiple smaller and more atomic\r
+> patches.  In particular, the addition of the sexp output format needs to\r
+> definitely be in a separate patch from the restructuring of the output\r
+> formatting.  You also don't mention anywhere in the commit log that\r
+> you've added this new output format.  You'll also need to include\r
+> documentation and test suite updates.\r
+\r
+I'm sorry I forgot to mention that, it was mainly meant as a way to show\r
+that this is easily possible (i.e. that the formatting is decoupled from\r
+the logic, so that additional and different formats can be added without\r
+influencing the printing logic). It'd be easy to split this up. What\r
+kind of documentation should I include? \r
+The test suite should work fine, *if* it compares EXPECTED and OUTPUT\r
+not character-by-character, but rather by pretty-printing both the\r
+expected and the actual outputs by some JSON pretty-printer (like python\r
+-mjson.tool). I can of course provide additional test-cases for\r
+--format=sexp.\r
+\r
+How should I proceed on this? Re-submit the patch with the sexp-support\r
+removed and only JSON updated?\r
+\r
+Thanks!\r
+\r
+Peter\r