]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: avoid killing process buffer when process is still alive
authorJonas Bernoulli <jonas@bernoul.li>
Sun, 10 Jan 2021 14:00:45 +0000 (15:00 +0100)
committerDavid Bremner <david@tethera.net>
Wed, 13 Jan 2021 11:08:13 +0000 (07:08 -0400)
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.

emacs/notmuch-lib.el

index e09912d3174fbf45f089745e317e8350e0c6f364..0e235fa365412dd0371c20af7b571479dad2361b 100644 (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)