[PATCH v2 00/14] reply refactor, fixes
[notmuch-archives.git] / 63 / eda2608387185e71200b9f0b47ee3848ee8a10
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 9059E431FBC\r
6         for <notmuch@notmuchmail.org>; Sat, 15 Dec 2012 11:51:04 -0800 (PST)\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 V28ChLbAI2vk for <notmuch@notmuchmail.org>;\r
16         Sat, 15 Dec 2012 11:51:04 -0800 (PST)\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU\r
18         [18.7.68.37])\r
19         by olra.theworths.org (Postfix) with ESMTP id 121FC431FB6\r
20         for <notmuch@notmuchmail.org>; Sat, 15 Dec 2012 11:51:03 -0800 (PST)\r
21 X-AuditID: 12074425-b7f606d0000008ea-b8-50ccd4a7cf31\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
23         by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 1A.E8.02282.7A4DCC05; Sat, 15 Dec 2012 14:51:03 -0500 (EST)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id qBFJp3jO011807; \r
27         Sat, 15 Dec 2012 14:51:03 -0500\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.6/8.12.4) with ESMTP id qBFJp11R022951\r
32         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
33         Sat, 15 Dec 2012 14:51:02 -0500 (EST)\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 1TjxlF-0003FX-4l; Sat, 15 Dec 2012 14:51:01 -0500\r
37 From: Austin Clements <amdragon@MIT.EDU>\r
38 To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
39 Subject: Re: [PATCH 2/7] emacs: Use unified error handling in\r
40         notmuch-call-notmuch-process\r
41 In-Reply-To: <876243hdcc.fsf@qmul.ac.uk>\r
42 References: <1355548513-10085-1-git-send-email-amdragon@mit.edu>\r
43         <1355548513-10085-3-git-send-email-amdragon@mit.edu>\r
44         <876243hdcc.fsf@qmul.ac.uk>\r
45 User-Agent: Notmuch/0.14+184~gc26cc51 (http://notmuchmail.org) Emacs/23.4.1\r
46         (i486-pc-linux-gnu)\r
47 Date: Sat, 15 Dec 2012 14:51:01 -0500\r
48 Message-ID: <874njnxffe.fsf@awakening.csail.mit.edu>\r
49 MIME-Version: 1.0\r
50 Content-Type: text/plain; charset=us-ascii\r
51 X-Brightmail-Tracker:\r
52  H4sIAAAAAAAAA+NgFnrIIsWRmVeSWpSXmKPExsUixG6nrrv8ypkAg8PXRSxWz+WxuH5zJrMD\r
53         k8fOWXfZPZ6tusUcwBTFZZOSmpNZllqkb5fAlTFhyS72gn0CFW//XWBqYJzM28XIySEhYCKx\r
54         9HIPK4QtJnHh3nq2LkYuDiGBfYwSh7Ysh3I2MEo0TzzGBOFcZJI4PWsnC4SzhFHi1uab7CD9\r
55         bAIaEtv2L2cEsUUEXCWefvvMDGILC0RJLHlxE8zmBKpZN+M1O0TzREaJ1qv3gBo4OEQF4iXO\r
56         LjUBqWERUJV48/AKE4jNC3Tf96m/WCBsQYmTM5+A2cwCWhI3/r1kmsAoMAtJahaS1AJGplWM\r
57         sim5Vbq5iZk5xanJusXJiXl5qUW6Fnq5mSV6qSmlmxjBIemiuoNxwiGlQ4wCHIxKPLw7Ik4H\r
58         CLEmlhVX5h5ilORgUhLlrTh3JkCILyk/pTIjsTgjvqg0J7X4EKMEB7OSCG/SfKAcb0piZVVq\r
59         UT5MSpqDRUmc90bKTX8hgfTEktTs1NSC1CKYrAwHh5IEb8BloEbBotT01Iq0zJwShDQTByfI\r
60         cB6g4awgNbzFBYm5xZnpEPlTjIpS4ryeIAkBkERGaR5cLyxlvGIUB3pFmDcPpIoHmG7gul8B\r
61         DWYCGrzcBmxwSSJCSqqBUfxYVFb0FP/GDRdl/n858/tU1rmIhqSZU48bz99/Tfdy17TTH9Y4\r
62         N8WXzilqW/Lh8+KqqeVfv+T9eVQmzKGv8yruNPMR3R/RJaLTkjrkLNyS7100zrI5/88np+bA\r
63         zKSdc296NOft+/h1b6T5panahk6+eZPYPhV9jzjp98m1aXrW5hC/dSf3mSixFGckGmoxFxUn\r
64         AgAkEw7x9AIAAA==\r
65 X-BeenThere: notmuch@notmuchmail.org\r
66 X-Mailman-Version: 2.1.13\r
67 Precedence: list\r
68 List-Id: "Use and development of the notmuch mail system."\r
69         <notmuch.notmuchmail.org>\r
70 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
71         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
72 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
73 List-Post: <mailto:notmuch@notmuchmail.org>\r
74 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
75 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
76         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
77 X-List-Received-Date: Sat, 15 Dec 2012 19:51:04 -0000\r
78 \r
79 On Sat, 15 Dec 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
80 > On Sat, 15 Dec 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
81 >> This makes notmuch-call-notmuch-process use the unified CLI error\r
82 >> handling, which basically refines the error handling this function\r
83 >> already did.\r
84 >> ---\r
85 >>  emacs/notmuch.el |   15 ++++-----------\r
86 >>  1 file changed, 4 insertions(+), 11 deletions(-)\r
87 >>\r
88 >> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
89 >> index f9454d8..e25b54e 100644\r
90 >> --- a/emacs/notmuch.el\r
91 >> +++ b/emacs/notmuch.el\r
92 >> @@ -538,17 +538,10 @@ If BARE is set then do not prefix with \"thread:\""\r
93 >>  \r
94 >>  Output from the process will be presented to the user as an error\r
95 >>  and will also appear in a buffer named \"*Notmuch errors*\"."\r
96 >\r
97 > This comment looks like it is not true (but wasn't true before\r
98 > either). I think output will only be presented to the user if notmuch\r
99 > exits with a non-zero status?\r
100 \r
101 Fixed.\r
102 \r
103 >> -  (let ((error-buffer (get-buffer-create "*Notmuch errors*")))\r
104 >> -    (with-current-buffer error-buffer\r
105 >> -    (erase-buffer))\r
106 >> -    (if (eq (apply 'call-process notmuch-command nil error-buffer nil args) 0)\r
107 >> -    (point)\r
108 >> -      (progn\r
109 >> -    (with-current-buffer error-buffer\r
110 >> -      (let ((beg (point-min))\r
111 >> -            (end (- (point-max) 1)))\r
112 >> -        (error (buffer-substring beg end))\r
113 >> -        ))))))\r
114 >> +  (with-temp-buffer\r
115 >> +    (let ((status (apply #'call-process notmuch-command nil t nil args)))\r
116 >> +      (notmuch-check-exit-status status (cons notmuch-command args)\r
117 >> +                             (buffer-string)))))\r
118 >>  \r
119 >\r
120 > Would it be worth separating stderr and stdout here? (Quite plausibly it\r
121 > isn't.)\r
122 \r
123 Actually I think it's better to not separate stdout and stderr when we\r
124 can avoid it, since stdout may give context for what's on stderr.  When\r
125 we're trying to interpret stdout it's important to separate it, but\r
126 that's not the case here.\r
127 \r
128 > Best wishes\r
129 >\r
130 > Mark\r
131 >\r
132 >\r
133 >>  (defun notmuch-search-set-tags (tags &optional pos)\r
134 >>    (let ((new-result (plist-put (notmuch-search-get-result pos) :tags tags)))\r
135 >> -- \r
136 >> 1.7.10.4\r