1 Return-Path: <m.walters@qmul.ac.uk>
\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 127DD431FB6
\r
6 for <notmuch@notmuchmail.org>; Mon, 24 Jun 2013 12:29:47 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5
\r
12 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,
\r
13 NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 go8QDVC32lye for <notmuch@notmuchmail.org>;
\r
17 Mon, 24 Jun 2013 12:29:39 -0700 (PDT)
\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])
\r
19 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id EDA6A431FAF
\r
22 for <notmuch@notmuchmail.org>; Mon, 24 Jun 2013 12:29:38 -0700 (PDT)
\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])
\r
24 by mail2.qmul.ac.uk with esmtp (Exim 4.71)
\r
25 (envelope-from <m.walters@qmul.ac.uk>)
\r
26 id 1UrCSH-00024D-6O; Mon, 24 Jun 2013 20:29:37 +0100
\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)
\r
28 by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)
\r
29 (envelope-from <m.walters@qmul.ac.uk>)
\r
30 id 1UrCSG-0005M3-T4; Mon, 24 Jun 2013 20:29:37 +0100
\r
31 From: Mark Walters <markwalters1009@gmail.com>
\r
32 To: Austin Clements <amdragon@MIT.EDU>
\r
33 Subject: Re: [PATCH 1/3] emacs: Introduce `notmuch-call-notmuch-sexp'
\r
34 In-Reply-To: <20130624191115.GB2214@mit.edu>
\r
35 References: <1372030999-1262-1-git-send-email-amdragon@mit.edu>
\r
36 <87zjuftjuc.fsf@qmul.ac.uk> <20130624191115.GB2214@mit.edu>
\r
37 User-Agent: Notmuch/0.15.2+171~ge2f30a2 (http://notmuchmail.org) Emacs/23.4.1
\r
38 (x86_64-pc-linux-gnu)
\r
39 Date: Mon, 24 Jun 2013 20:29:35 +0100
\r
40 Message-ID: <87sj07tihs.fsf@qmul.ac.uk>
\r
42 Content-Type: text/plain; charset=us-ascii
\r
43 X-Sender-Host-Address: 93.97.24.31
\r
44 X-QM-SPAM-Info: Sender has good ham record. :)
\r
45 X-QM-Body-MD5: 04fc758cdd527537c2a7291ded30bff4 (of first 20000 bytes)
\r
46 X-SpamAssassin-Score: -0.0
\r
47 X-SpamAssassin-SpamBar: /
\r
48 X-SpamAssassin-Report: The QM spam filters have analysed this message to
\r
50 spam. We require at least 5.0 points to mark a message as spam.
\r
51 This message scored -0.0 points.
\r
52 Summary of the scoring:
\r
53 * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail
\r
54 provider * (markwalters1009[at]gmail.com)
\r
55 * -0.0 AWL AWL: From: address is in the auto white-list
\r
56 X-QM-Scan-Virus: ClamAV says the message is clean
\r
57 Cc: notmuch@notmuchmail.org
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\r
61 List-Id: "Use and development of the notmuch mail system."
\r
62 <notmuch.notmuchmail.org>
\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
66 List-Post: <mailto:notmuch@notmuchmail.org>
\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
70 X-List-Received-Date: Mon, 24 Jun 2013 19:29:47 -0000
\r
75 (I think I only moved your code from one file to another but in any case
\r
76 what you suggest is fine.)
\r
83 On Mon, 24 Jun 2013, Austin Clements <amdragon@MIT.EDU> wrote:
\r
84 > Yes, and thanks for reminding me about the require's. I'll do that in
\r
85 > a follow up. I was thinking of just moving the streaming JSON parser
\r
86 > to a repo on my GitHub account, since maybe somebody some day will
\r
87 > find a use for it, or at least take inspiration from the API (I looked
\r
88 > into streaming JSON parser APIs before embarking on that one and
\r
89 > they're all terrible!) Mark, you're the only other person who has
\r
90 > touched that code. Is this plan good with you?
\r
92 > Quoth Mark Walters on Jun 24 at 8:00 pm:
\r
94 >> This series looks good to me +1.
\r
96 >> Is it worth removing all the json (3 files with (require 'json) and the
\r
97 >> async json parser) too?
\r
103 >> On Mon, 24 Jun 2013, Austin Clements <amdragon@MIT.EDU> wrote:
\r
104 >> > This is just like `notmuch-call-notmuch-json', but parses S-expression
\r
105 >> > output. Note that, also like `notmuch-call-notmuch-json', this
\r
106 >> > doesn't consider trailing data to be an error, which may or may not be
\r
107 >> > what we want in the long run.
\r
109 >> > emacs/notmuch-lib.el | 17 +++++++++++++++++
\r
110 >> > 1 file changed, 17 insertions(+)
\r
112 >> > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
\r
113 >> > index 534f217..36eacc1 100644
\r
114 >> > --- a/emacs/notmuch-lib.el
\r
115 >> > +++ b/emacs/notmuch-lib.el
\r
116 >> > @@ -484,6 +484,23 @@ an error."
\r
118 >> > (delete-file err-file)))))
\r
120 >> > +(defun notmuch-call-notmuch-sexp (&rest args)
\r
121 >> > + "Invoke `notmuch-command' with ARGS and return the parsed S-exp output.
\r
123 >> > +If notmuch exits with a non-zero status, this will pop up a
\r
124 >> > +buffer containing notmuch's output and signal an error."
\r
126 >> > + (with-temp-buffer
\r
127 >> > + (let ((err-file (make-temp-file "nmerr")))
\r
128 >> > + (unwind-protect
\r
129 >> > + (let ((status (apply #'call-process
\r
130 >> > + notmuch-command nil (list t err-file) nil args)))
\r
131 >> > + (notmuch-check-exit-status status (cons notmuch-command args)
\r
132 >> > + (buffer-string) err-file)
\r
133 >> > + (goto-char (point-min))
\r
134 >> > + (read (current-buffer)))
\r
135 >> > + (delete-file err-file)))))
\r
137 >> > (defun notmuch-start-notmuch (name buffer sentinel &rest args)
\r
138 >> > "Start and return an asynchronous notmuch command.
\r