From 19e5b2d912b52145403c3f11b0c30c84d7f2b409 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sat, 15 Dec 2012 15:04:19 -0500 Subject: emacs: Use unified error handling in search This slightly changes the output of an existing test since we now report non-zero exits with a pop-up buffer instead of at the end of the search results. --- emacs/notmuch-lib.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'emacs/notmuch-lib.el') diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index dd2c78ba..8e754edf 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -334,6 +334,19 @@ the user dismisses it." (insert "\n")))) (pop-to-buffer buf))) +(defun notmuch-check-async-exit-status (proc msg) + "If PROC exited abnormally, pop up an error buffer and signal an error. + +This is a wrapper around `notmuch-check-exit-status' for +asynchronous process sentinels. PROC and MSG must be the +arguments passed to the sentinel." + (let ((exit-status + (case (process-status proc) + ((exit) (process-exit-status proc)) + ((signal) msg)))) + (when exit-status + (notmuch-check-exit-status exit-status (process-command proc))))) + (defun notmuch-check-exit-status (exit-status command &optional output err-file) "If EXIT-STATUS is non-zero, pop up an error buffer and signal an error. -- cgit v1.2.3