About the json output and the number of results shown.
authorChristophe-Marie Duquesne <chm.duquesne@gmail.com>
Wed, 12 Jan 2011 18:37:21 +0000 (19:37 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:42 +0000 (09:37 -0800)
1c/4b01f9d437bfdd1b6f08dc50d16c3c35f4c93f [new file with mode: 0644]

diff --git a/1c/4b01f9d437bfdd1b6f08dc50d16c3c35f4c93f b/1c/4b01f9d437bfdd1b6f08dc50d16c3c35f4c93f
new file mode 100644 (file)
index 0000000..b19644e
--- /dev/null
@@ -0,0 +1,90 @@
+Return-Path: <chm.duquesne@gmail.com>\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 4A8B442D2BA\r
+       for <notmuch@notmuchmail.org>; Wed, 12 Jan 2011 10:37:45 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 rU-gHb6+ifwD for <notmuch@notmuchmail.org>;\r
+       Wed, 12 Jan 2011 10:37:44 -0800 (PST)\r
+Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
+       [74.125.82.181])\r
+       by olra.theworths.org (Postfix) with ESMTP id 67F5842D2B1\r
+       for <notmuch@notmuchmail.org>; Wed, 12 Jan 2011 10:37:44 -0800 (PST)\r
+Received: by wyf22 with SMTP id 22so907838wyf.26\r
+       for <notmuch@notmuchmail.org>; Wed, 12 Jan 2011 10:37:42 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:mime-version:from:date:message-id:subject:to\r
+       :content-type; bh=xlFdPLszRtZW/C2C2VYaoylLAFVeNGpv41toBTNzwVg=;\r
+       b=BAYLl0izFsL5PoErUGfiJ3PtpGzn/2nUXjweJAI880SwlK4sg87l3jjF+4bO8W3Tcw\r
+       Ub/FceO5Iht+BQHXGqw8anKt5P/pY0m3jaD13TdZP+oYHsqEi0hkDg5zuPSx/GqnPFA5\r
+       uIXrI4PPEBPX5Hsoi89tD8Wd3vUYQL+PG2vhg=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=mime-version:from:date:message-id:subject:to:content-type;\r
+       b=drVYhvCuvMeByl5lyUd6D+WMOp9GxogGyzvAqBdKVIaRxTGvbDKQ51BNg5GNDQ4onc\r
+       i5xpLL+At7NLq8iV76v3p0dAO5iaaA6qrFn29lGXTBQnE50cXoSKUrDmG+/whK8Ux0DR\r
+       pZW4M9QbjG/k6+I+v43LnhoUKdVksaf6BuRRo=\r
+Received: by 10.227.146.195 with SMTP id i3mr1391952wbv.67.1294857461961; Wed,\r
+       12 Jan 2011 10:37:41 -0800 (PST)\r
+MIME-Version: 1.0\r
+Received: by 10.227.143.206 with HTTP; Wed, 12 Jan 2011 10:37:21 -0800 (PST)\r
+From: Christophe-Marie Duquesne <chm.duquesne@gmail.com>\r
+Date: Wed, 12 Jan 2011 19:37:21 +0100\r
+Message-ID: <AANLkTi=Mzu9bu3y0RKB5YZUpZOT9qujXgxtpB-8Bvk=2@mail.gmail.com>\r
+Subject: About the json output and the number of results shown.\r
+To: notmuch@notmuchmail.org\r
+Content-Type: text/plain; charset=UTF-8\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: Wed, 12 Jan 2011 18:37:45 -0000\r
+\r
+Hi,\r
+\r
+The notmuch command line tool has an option that seems very\r
+interesting to me: --output=json\r
+\r
+In several languages, and especially in python, json is as easy to parse as:\r
+>>> res = json.load(stream)\r
+If your stream contains valid json, you then get all your data in res\r
+and you can immediately use it.\r
+\r
+With notmuch, some commands can bring a lot of results, and can take\r
+some time to return. That is why when I began to write a curse\r
+interface to notmuch, I added a mechanism to spawn these commands in\r
+background and gather the results asynchronously. Sadly, this makes me\r
+unable to use the built-in python json parser: As long as the output\r
+has not finished, the data on the stream is not valid json since it\r
+lacks at least the closing bracket '}'. As a consequence, I find\r
+easier not to use json and parse the data as it arrives.\r
+\r
+So I am wondering: what is the point of having a tool that is able to\r
+output json and ending in not using it? Is there a solution to make\r
+the json output more useable? One solution I've been thinking about\r
+would be to add an option: the range of results to show (something\r
+like --range=25:50). Is it doable easily? I mean: if results are not\r
+guaranteed to be in a given order, that would obviously be an issue.\r
+Same if finding the results 25:50 is exactly as long as finding the\r
+results 1:50. Otherwise, if it is doable, I guess this mail is a\r
+feature request. In any case, do you have any proposal for making\r
+sense of this json output without modifications in the notmuch CLI?\r
+\r
+Cheers,\r
+Christophe-Marie Duquesne\r