From: Jonas Bernoulli Date: Sun, 10 Jan 2021 14:00:45 +0000 (+0100) Subject: emacs: avoid killing process buffer when process is still alive X-Git-Tag: 0.32_rc0~154 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=adc123e4fd6384fba0165ebddc99d4323f6bee73 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. --- 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)