diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index e09912d3..0e235fa3 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -960,9 +960,10 @@ status." (message "%s" (error-message-string err)))))) (defun notmuch-start-notmuch-error-sentinel (proc event) - (let ((buffer (process-buffer proc))) - (when (buffer-live-p buffer) - (kill-buffer buffer)))) + (unless (process-live-p proc) + (let ((buffer (process-buffer proc))) + (when (buffer-live-p buffer) + (kill-buffer buffer))))) (defvar-local notmuch-show-process-crypto nil)