1 Return-Path: <markwalters1009@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 arlo.cworth.org (Postfix) with ESMTP id 0BE4A6DE17EE
\r
6 for <notmuch@notmuchmail.org>; Wed, 28 Oct 2015 11:28:55 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=-0.907 tagged_above=-999 required=5
\r
12 tests=[AWL=-0.337, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
\r
13 DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25,
\r
14 FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,
\r
15 RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled
\r
16 Received: from arlo.cworth.org ([127.0.0.1])
\r
17 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
18 with ESMTP id GnnHZlPOcndE for <notmuch@notmuchmail.org>;
\r
19 Wed, 28 Oct 2015 11:28:53 -0700 (PDT)
\r
20 Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com
\r
22 by arlo.cworth.org (Postfix) with ESMTPS id D1D726DE0C11
\r
23 for <notmuch@notmuchmail.org>; Wed, 28 Oct 2015 11:28:52 -0700 (PDT)
\r
24 Received: by wijp11 with SMTP id p11so266187750wij.0
\r
25 for <notmuch@notmuchmail.org>; Wed, 28 Oct 2015 11:28:46 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
\r
27 h=from:to:cc:subject:date:message-id:in-reply-to:references;
\r
28 bh=7CDeicInkt/bhzEFrlI2DDbqPn8Q4iCX7KncKQ8iPXk=;
\r
29 b=DdARa3CnzezO/1/3tbcSrmacEP0EoVHuNdjv0UUriVfKZr6jKva2dnRgj5C75Yj0mW
\r
30 TT5lnorf7S5S052eLrGkCMeqDXc/eScf35N96/mqWDkH1s0CmIRAk4o3BOIxoBAUKRdw
\r
31 CbjLOy0wk5sfv4ocBOqjshPGmkKf5YO+CPdIZf28mtgp/OHFGo/xTL/dCKHtt4OncuBj
\r
32 xuS+InAFi5BAhRdqoXZggdcRGk4i/D74lv6XalYrL/yR1XW39lPPzNoKGlmHvk3iIMqJ
\r
33 S6XpGqUhHEBsGMixf5EwfKGr2WsSfHvf0q9gh4vQqlz6k495djPjoCc1TNcMFekRL6UQ
\r
35 X-Received: by 10.194.122.42 with SMTP id lp10mr41035957wjb.51.1446056926162;
\r
36 Wed, 28 Oct 2015 11:28:46 -0700 (PDT)
\r
37 Received: from localhost (188.29.75.230.threembb.co.uk. [188.29.75.230])
\r
38 by smtp.gmail.com with ESMTPSA id p4sm1384840wif.22.2015.10.28.11.28.44
\r
39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
\r
40 Wed, 28 Oct 2015 11:28:45 -0700 (PDT)
\r
41 From: Mark Walters <markwalters1009@gmail.com>
\r
42 To: notmuch@notmuchmail.org,
\r
44 Subject: [PATCH] emacs: poll: return useful errors when poll fails.
\r
45 Date: Wed, 28 Oct 2015 18:28:39 +0000
\r
46 Message-Id: <1446056919-27822-1-git-send-email-markwalters1009@gmail.com>
\r
47 X-Mailer: git-send-email 2.1.4
\r
48 In-Reply-To: <87bnd5qjnd.fsf@wespe.malde.org>
\r
49 References: <87bnd5qjnd.fsf@wespe.malde.org>
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.20
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Wed, 28 Oct 2015 18:28:55 -0000
\r
64 Previously poll called from emacs would fail silently. This makes it
\r
65 return a useful error message.
\r
67 In the non-deprecated case of notmuch new and appropriate hooks, it
\r
68 uses notmuch-call-notmuch-process which gives an error and
\r
69 additionally puts the stdout/stderr etc in the *Notmuch errors*
\r
72 In the deprecated case of a custom poll script it only returns an
\r
75 Commit based on a bug report, and a potential fix, by Ketil Malde.
\r
78 This should fix the bug reported in the parent message -- we should
\r
79 definitely report error messages. It might be nice to output the
\r
80 stdout/stderr in the custom poll script case but since we don't have
\r
81 built in infrastructure for it it probably isn't worth it for a
\r
84 (Note I don't use poll, so this is not heavily tested)
\r
92 emacs/notmuch-lib.el | 5 +++--
\r
93 1 file changed, 3 insertions(+), 2 deletions(-)
\r
95 diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
\r
96 index 1c3a9fe..89c01a5 100644
\r
97 --- a/emacs/notmuch-lib.el
\r
98 +++ b/emacs/notmuch-lib.el
\r
99 @@ -243,8 +243,9 @@ depending on the value of `notmuch-poll-script'."
\r
101 (if (stringp notmuch-poll-script)
\r
102 (unless (string= notmuch-poll-script "")
\r
103 - (call-process notmuch-poll-script nil nil))
\r
104 - (call-process notmuch-command nil nil nil "new")))
\r
105 + (unless (equal (call-process notmuch-poll-script nil nil) 0)
\r
106 + (error "Notmuch: poll script `%s' failed!" notmuch-poll-script)))
\r
107 + (notmuch-call-notmuch-process "new")))
\r
109 (defun notmuch-bury-or-kill-this-buffer ()
\r
110 "Undisplay the current buffer.
\r