emacs: avoid killing process buffer when process is still alive

In practice this probably does not make a difference or we would
have heard about it many times, but better be safe than sorry.

Process sentinels are called not only when the process has finished
but also on other state changes.
This commit is contained in:
Jonas Bernoulli 2021-01-10 15:00:45 +01:00 committed by David Bremner
parent 904ffbc925
commit adc123e4fd

View file

@ -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)