[feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / 34 / 7e773ca9243e9baab6cb8f09f1164ed996bd8e
1 Return-Path: <amdragon@mit.edu>\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 3701B431FBD\r
6         for <notmuch@notmuchmail.org>; Mon, 24 Jun 2013 12:11:45 -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.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 8k452kYCOqN7 for <notmuch@notmuchmail.org>;\r
16         Mon, 24 Jun 2013 12:11:36 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu\r
18         [18.9.25.14])\r
19         by olra.theworths.org (Postfix) with ESMTP id 4CD73431FAF\r
20         for <notmuch@notmuchmail.org>; Mon, 24 Jun 2013 12:11:36 -0700 (PDT)\r
21 X-AuditID: 1209190e-b7f988e0000009a7-38-51c899e7f14f\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
23         by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 3D.F4.02471.7E998C15; Mon, 24 Jun 2013 15:11:35 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
26         by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id r5OJBP7f013758; \r
27         Mon, 24 Jun 2013 15:11:35 -0400\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r5OJBIn2020025\r
32         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
33         Mon, 24 Jun 2013 15:11:19 -0400\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1UrCAX-00049U-40; Mon, 24 Jun 2013 15:11:17 -0400\r
37 Date: Mon, 24 Jun 2013 15:11:16 -0400\r
38 From: Austin Clements <amdragon@MIT.EDU>\r
39 To: Mark Walters <markwalters1009@gmail.com>\r
40 Subject: Re: [PATCH 1/3] emacs: Introduce `notmuch-call-notmuch-sexp'\r
41 Message-ID: <20130624191115.GB2214@mit.edu>\r
42 References: <1372030999-1262-1-git-send-email-amdragon@mit.edu>\r
43         <87zjuftjuc.fsf@qmul.ac.uk>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 Content-Disposition: inline\r
47 In-Reply-To: <87zjuftjuc.fsf@qmul.ac.uk>\r
48 User-Agent: Mutt/1.5.21 (2010-09-15)\r
49 X-Brightmail-Tracker:\r
50  H4sIAAAAAAAAA+NgFmpkleLIzCtJLcpLzFFi42IR4hTV1n0+80SgweltFhar5/JYXL85k9mB\r
51         yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgyrhwYD1LwW7BiumfJBoYj/F2MXJySAiYSJz5\r
52         d5cZwhaTuHBvPRuILSSwj1Fi/hTXLkYuIHsjo8Tl1jnMEM5pJolXZx6wQzhLGCVO7N7NBNLC\r
53         IqAqsW//MXYQm01AQ2Lb/uWMILaIgI7E7UMLwOLMAtIS3343g9ULC7hKdM1cxQpi8wpoS8yd\r
54         fJEJYnWsxM1NV5kh4oISJ2c+YYHo1ZK48e8lUA0H2Jzl/zhAwpxAqw59vwrWKiqgIjHl5Da2\r
55         CYxCs5B0z0LSPQuhewEj8ypG2ZTcKt3cxMyc4tRk3eLkxLy81CJdY73czBK91JTSTYzgkJbk\r
56         28H49aDSIUYBDkYlHt4ZMScChVgTy4orcw8xSnIwKYnyfp8OFOJLyk+pzEgszogvKs1JLT7E\r
57         KMHBrCTCGyoClONNSaysSi3Kh0lJc7AoifOK3toZKCSQnliSmp2aWpBaBJOV4eBQkuBdNQOo\r
58         UbAoNT21Ii0zpwQhzcTBCTKcB2h4D0gNb3FBYm5xZjpE/hSjopQ471eQhABIIqM0D64XlnJe\r
59         MYoDvSLMyw1MQEI8wHQF1/0KaDAT0ODJqcdBBpckIqSkGhgDSlm1er9O35u/Svf9uUddmSGn\r
60         /koZmL7Y9VM/kYOzUPme686u7GUXJuUfnC8VvEZY9+TfKu8PZ2/dqV15ySJ3N4dhPe/ZO+Kv\r
61         vD4tO3/xTUPKAc7eOOsb9dudHa3KUm531uh0Nzw3uzvLIPT7CdUdN/5lGa5Jc3syb87ddK/r\r
62         64/v3OJhe75JiaU4I9FQi7moOBEAgdalhRQDAAA=\r
63 Cc: notmuch@notmuchmail.org\r
64 X-BeenThere: notmuch@notmuchmail.org\r
65 X-Mailman-Version: 2.1.13\r
66 Precedence: list\r
67 List-Id: "Use and development of the notmuch mail system."\r
68         <notmuch.notmuchmail.org>\r
69 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
71 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
72 List-Post: <mailto:notmuch@notmuchmail.org>\r
73 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
74 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
75         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
76 X-List-Received-Date: Mon, 24 Jun 2013 19:11:45 -0000\r
77 \r
78 Yes, and thanks for reminding me about the require's.  I'll do that in\r
79 a follow up.  I was thinking of just moving the streaming JSON parser\r
80 to a repo on my GitHub account, since maybe somebody some day will\r
81 find a use for it, or at least take inspiration from the API (I looked\r
82 into streaming JSON parser APIs before embarking on that one and\r
83 they're all terrible!)  Mark, you're the only other person who has\r
84 touched that code.  Is this plan good with you?\r
85 \r
86 Quoth Mark Walters on Jun 24 at  8:00 pm:\r
87\r
88 > This series looks good to me +1. \r
89\r
90 > Is it worth removing all the json (3 files with (require 'json) and the\r
91 > async json parser) too?\r
92\r
93 > Best wishes\r
94\r
95 > Mark\r
96\r
97 > On Mon, 24 Jun 2013, Austin Clements <amdragon@MIT.EDU> wrote:\r
98 > > This is just like `notmuch-call-notmuch-json', but parses S-expression\r
99 > > output.  Note that, also like `notmuch-call-notmuch-json', this\r
100 > > doesn't consider trailing data to be an error, which may or may not be\r
101 > > what we want in the long run.\r
102 > > ---\r
103 > >  emacs/notmuch-lib.el |   17 +++++++++++++++++\r
104 > >  1 file changed, 17 insertions(+)\r
105 > >\r
106 > > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
107 > > index 534f217..36eacc1 100644\r
108 > > --- a/emacs/notmuch-lib.el\r
109 > > +++ b/emacs/notmuch-lib.el\r
110 > > @@ -484,6 +484,23 @@ an error."\r
111 > >           (json-read)))\r
112 > >     (delete-file err-file)))))\r
113 > >  \r
114 > > +(defun notmuch-call-notmuch-sexp (&rest args)\r
115 > > +  "Invoke `notmuch-command' with ARGS and return the parsed S-exp output.\r
116 > > +\r
117 > > +If notmuch exits with a non-zero status, this will pop up a\r
118 > > +buffer containing notmuch's output and signal an error."\r
119 > > +\r
120 > > +  (with-temp-buffer\r
121 > > +    (let ((err-file (make-temp-file "nmerr")))\r
122 > > +      (unwind-protect\r
123 > > +     (let ((status (apply #'call-process\r
124 > > +                          notmuch-command nil (list t err-file) nil args)))\r
125 > > +       (notmuch-check-exit-status status (cons notmuch-command args)\r
126 > > +                                  (buffer-string) err-file)\r
127 > > +       (goto-char (point-min))\r
128 > > +       (read (current-buffer)))\r
129 > > +   (delete-file err-file)))))\r
130 > > +\r
131 > >  (defun notmuch-start-notmuch (name buffer sentinel &rest args)\r
132 > >    "Start and return an asynchronous notmuch command.\r