Re: [PATCH] cli: crypto: tell gmime to use gpg-agent
[notmuch-archives.git] / 77 / d0931eb4a563d1de0a5e1fa7b303bc367bfa96
1 Return-Path: <tomi.ollila@iki.fi>\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 79731431FBC\r
6         for <notmuch@notmuchmail.org>; Sun,  1 Jul 2012 15:13:27 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id aYiPhJPCvnTm for <notmuch@notmuchmail.org>;\r
16         Sun,  1 Jul 2012 15:13:26 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 20ECB431FAF\r
19         for <notmuch@notmuchmail.org>; Sun,  1 Jul 2012 15:13:26 -0700 (PDT)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id A761B100637; Mon,  2 Jul 2012 01:13:34 +0300 (EEST)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
24 Subject: Re: [PATCH] cli: notmuch-show with framing newlines between threads\r
25         in JSON.\r
26 In-Reply-To: <1341041024-5342-1-git-send-email-markwalters1009@gmail.com>\r
27 References: <1341041024-5342-1-git-send-email-markwalters1009@gmail.com>\r
28 User-Agent: Notmuch/0.13.2+7~g2fb5bbc (http://notmuchmail.org) Emacs/23.1.1\r
29         (x86_64-redhat-linux-gnu)\r
30 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
31         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
32         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
33 Date: Mon, 02 Jul 2012 01:13:34 +0300\r
34 Message-ID: <m24npr8701.fsf@guru.guru-group.fi>\r
35 MIME-Version: 1.0\r
36 Content-Type: text/plain; charset=us-ascii\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Sun, 01 Jul 2012 22:13:27 -0000\r
50 \r
51 On Sat, Jun 30 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
52 \r
53 > Add newlines between complete threads to make asynchronous parsing\r
54 > of the JSON easier.\r
55 > ---\r
56 >\r
57 > notmuch-pick uses the JSON output of notmuch show but, in many cases,\r
58 > for many threads. This can take quite a long time when displaying a\r
59 > large number of messages (say 20 seconds for the 10,000 messages in\r
60 > the notmuch archive). Thus it is desirable to display results\r
61 > incrementally in the same way that search currently does.\r
62 >\r
63 > To make this easier this patch adds newlines between each toplevel\r
64 > thread. So the ouput becomes\r
65 >\r
66 > [\r
67 > thread1\r
68 > , thread2\r
69 > , thread3\r
70 > ...\r
71 > , last_thread\r
72 > ]\r
73 >\r
74 > Thus the parser can easily tell if it has enough data to do some more\r
75 > parsing.\r
76 >\r
77 > Obviously, this changes the JSON output. This should not break any\r
78 > consumer as the JSON parsers should not mind. However, it does break\r
79 > several tests. Obviously, I will fix these but I wanted to check if\r
80 > people were basically happy with the change first.\r
81 \r
82 To provide this feature rather than relying on newlines the parser should\r
83 use it's state to notice when one thread ends. \r
84 \r
85 Such a change could be used (privately) for human consumption -- allowing \r
86 free change of whitespace during inspection (in a debugging session or so).\r
87 Computer software should not rely (or suffer) from any additional\r
88 (or lack thereof) whitespace there is...\r
89 \r
90 ... or at least a really convicing argument for the chance needs to\r
91 be presented (before "restricting" the json output notmuch spits out).\r
92 \r
93 Btw: AFAIC (json-read) parses the whole json object (ignoring whitespace,\r
94 including newlines outside strings). So I quess notmuch-pick uses something\r
95 slightly different (probably using json.el subroutines)..\r
96 \r
97 Btw2: I'm very interested to see notmuch-pick in action -- I just don't\r
98 see this a way to do this particular support properly.\r
99 \r
100 Btw3: is search is ever going to use json we'll face the same problem -- \r
101 unless writing each line as a separate json object (and starting to use \r
102 s-expressions for speed)\r
103 \r
104 > Also, should devel/schemata be updated? It seems a little unclear as\r
105 > this is not really a "JSON" change as the JSON does not care about the\r
106 > newlines.\r
107 >\r
108 > Best wishes\r
109 \r
110 and best luck with your notmuch-pick work.\r
111 \r
112 >\r
113 > Mark\r
114 \r
115 Tomi\r
116 \r
117 >\r
118 >\r
119 >  notmuch-show.c |    5 +++++\r
120 >  1 files changed, 5 insertions(+), 0 deletions(-)\r
121 >\r
122 > diff --git a/notmuch-show.c b/notmuch-show.c\r
123 > index 195e318..4a1d699 100644\r
124 > --- a/notmuch-show.c\r
125 > +++ b/notmuch-show.c\r
126 > @@ -942,6 +942,8 @@ do_show (void *ctx,\r
127 >  \r
128 >      if (format->message_set_start)\r
129 >       fputs (format->message_set_start, stdout);\r
130 > +    if (format == &format_json)\r
131 > +     fputs ("\n", stdout);\r
132 >  \r
133 >      for (threads = notmuch_query_search_threads (query);\r
134 >        notmuch_threads_valid (threads);\r
135 > @@ -963,6 +965,9 @@ do_show (void *ctx,\r
136 >       if (status && !res)\r
137 >           res = status;\r
138 >  \r
139 > +     if (format == &format_json)\r
140 > +         fputs ("\n", stdout);\r
141 > +\r
142 >       notmuch_thread_destroy (thread);\r
143 >  \r
144 >      }\r
145 > -- \r
146 > 1.7.9.1\r
147 >\r
148 > _______________________________________________\r
149 > notmuch mailing list\r
150 > notmuch@notmuchmail.org\r
151 > http://notmuchmail.org/mailman/listinfo/notmuch\r