aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Walters <markwalters1009@gmail.com>2015-10-28 18:28:39 +0000
committerDavid Bremner <david@tethera.net>2015-11-23 08:37:19 -0400
commit4c7a592d49266d588e717c232bc7aacbe4e16bfb (patch)
treecf203822a08b3f9ad3167ea21498cbfa15caf72a
parent3270eea39f048bc72df1f16bfa1300d7db169a1b (diff)
emacs: poll: return useful errors when poll fails.
Previously poll called from emacs would fail silently. This makes it return a useful error message. In the non-deprecated case of notmuch new and appropriate hooks, it uses notmuch-call-notmuch-process which gives an error and additionally puts the stdout/stderr etc in the *Notmuch errors* buffer. In the deprecated case of a custom poll script it only returns an error message. Commit based on a bug report, and a potential fix, by Ketil Malde.
-rw-r--r--emacs/notmuch-lib.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 201d7ec8..dedcbeb8 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -240,8 +240,9 @@ depending on the value of `notmuch-poll-script'."
(interactive)
(if (stringp notmuch-poll-script)
(unless (string= notmuch-poll-script "")
- (call-process notmuch-poll-script nil nil))
- (call-process notmuch-command nil nil nil "new")))
+ (unless (equal (call-process notmuch-poll-script nil nil) 0)
+ (error "Notmuch: poll script `%s' failed!" notmuch-poll-script)))
+ (notmuch-call-notmuch-process "new")))
(defun notmuch-bury-or-kill-this-buffer ()
"Undisplay the current buffer.