X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-lib.el;h=8e754edf435501c45d45d6e9f44d2cb805baa114;hp=dd2c78baeca928b1b8e239e1e2484d4068de49ac;hb=19e5b2d912b52145403c3f11b0c30c84d7f2b409;hpb=b3dc31f78d7b489e30842aa19733261769afb84d 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.