1 Return-Path: <ciprian.craciun@gmail.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 2ACA2429E25
\r
6 for <notmuch@notmuchmail.org>; Sat, 10 Dec 2011 14:46:52 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id vXVVG4ZrQZNG for <notmuch@notmuchmail.org>;
\r
17 Sat, 10 Dec 2011 14:46:51 -0800 (PST)
\r
18 Received: from mail-iy0-f181.google.com (mail-iy0-f181.google.com
\r
19 [209.85.210.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 9CBBC431FB6
\r
22 for <notmuch@notmuchmail.org>; Sat, 10 Dec 2011 14:46:51 -0800 (PST)
\r
23 Received: by iaoo28 with SMTP id o28so6296619iao.26
\r
24 for <notmuch@notmuchmail.org>; Sat, 10 Dec 2011 14:46:51 -0800 (PST)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
26 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
\r
27 :cc:content-type:content-transfer-encoding;
\r
28 bh=rg1E5oJ4/JFP4aqEkwp46vWcDAcIb8B63s7KqRb+GZA=;
\r
29 b=KKy/HkEpQyVIT4whbYF/zTHdcTGoAPT2+v9HWCp7KSPT1nZU4CO16lkP/oB84mxiUh
\r
30 SRilBkCg2SaPEIah+V/iLWD+HYZyutx1oo63rk+VsKQwjChhg1YqW8/oSq4mXibedoZP
\r
31 beLxCd2AsOahceHtan1FgrNuOA2yZPHDFDL/M=
\r
33 Received: by 10.182.221.72 with SMTP id qc8mr1670856obc.49.1323557211142; Sat,
\r
34 10 Dec 2011 14:46:51 -0800 (PST)
\r
35 Received: by 10.182.222.35 with HTTP; Sat, 10 Dec 2011 14:46:51 -0800 (PST)
\r
36 In-Reply-To: <87zkf05gk4.fsf@servo.finestructure.net>
\r
38 <CA+Tk8fycS4kmBRABRS4vFQLb3v0-ajcLZwPOwwEf98yvObgpwA@mail.gmail.com>
\r
39 <87zkf05gk4.fsf@servo.finestructure.net>
\r
40 Date: Sun, 11 Dec 2011 00:46:51 +0200
\r
42 <CA+Tk8fw+ky6hS0JGLQ4THOf+PSEZhSpfXRF=haayfAdF8HB6PQ@mail.gmail.com>
\r
43 Subject: Re: Exporting a single email as JSON
\r
44 From: Ciprian Dorin Craciun <ciprian.craciun@gmail.com>
\r
45 To: Jameson Graef Rollins <jrollins@finestructure.net>
\r
46 Content-Type: text/plain; charset=UTF-8
\r
47 Content-Transfer-Encoding: quoted-printable
\r
48 Cc: notmuch@notmuchmail.org
\r
49 X-BeenThere: notmuch@notmuchmail.org
\r
50 X-Mailman-Version: 2.1.13
\r
52 List-Id: "Use and development of the notmuch mail system."
\r
53 <notmuch.notmuchmail.org>
\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
55 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
57 List-Post: <mailto:notmuch@notmuchmail.org>
\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
60 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
61 X-List-Received-Date: Sat, 10 Dec 2011 22:46:52 -0000
\r
63 On Sat, Dec 10, 2011 at 22:15, Jameson Graef Rollins
\r
64 <jrollins@finestructure.net> wrote:
\r
65 > On Sat, 10 Dec 2011 20:32:22 +0200, Ciprian Dorin Craciun <ciprian.craciu=
\r
67 >> =C2=A0 =C2=A0 Quick question: why isn't it reasonable to export a **sing=
\r
69 >> email in JSON format (by using the `show` sub-command)? (I mean I
\r
70 >> understand that in order to be able to correctly parse the output we
\r
71 >> need only one "object" (i.e. a list of threads, containing a list of
\r
72 >> emails, etc.). But there might be use cases in which we need a
\r
75 > Hi, Ciprian. =C2=A0I agree that it would be nice too have the ability to
\r
76 > output single messages without the rest of their thread. =C2=A0I have on
\r
77 > occasion wanted this functionality, but never enough to get around to
\r
78 > implementing it. =C2=A0It definitely wouldn't be that hard to implement,
\r
81 > The notmuch show function is actually going through a pretty major
\r
82 > overhaul at the moment. =C2=A0I bet as soon as that's done we can get som=
\r
84 > sort of single-message output going.
\r
89 I've given a quick look into `notmuch-show.c` (commit from
\r
90 December 4) and indeed it seems quite trivial to add new formats.
\r
93 a) Is the code suitable for experimenting such a feature? (I mean
\r
94 is the "overhaul" almost done, or still in progress?)
\r
95 b) What would be the estimate for the "overhaul" completion? (To
\r
96 start prototyping such a feature...)
\r
97 c) Would someone else be interested in such a feature? (Or it's
\r
98 something so remote that only the two of us stumbled upon it?)
\r
100 I think it's quite hard to get this feature "right". I.e. I can
\r
101 see the following different -- but equally likely -- use-cases:
\r
102 * in my use-case I would need each line of the output to be a
\r
103 standalone JSON object of an individual message; (thus I can script
\r
104 with Bash `notmuch ... | while read message ; do ... ; done`;)
\r
105 * maybe someone else would need that the output to contain
\r
106 **exactly one** such message (maybe the first);
\r
107 * and maybe for someone else the use case involves having no
\r
108 `--entire-thread` by default;
\r
109 * further more someone else would actually prefer a "flatten" list
\r
110 of messages (not the currently nested list);
\r
111 * or maybe the separator in the first use case should be `\0`
\r
117 P.S.: I think all sub-commands that output line-feed separated
\r
118 records should also have the option to split them instead with `\0`.
\r
119 (I.e. `xargs` insists upon this I think, if not it separates by space
\r