]> git.eshelyaron.com Git - sweep.git/commitdiff
; Don't refuse to kill top-level buffer with deleted process
authorEshel Yaron <me@eshelyaron.com>
Thu, 14 Sep 2023 20:48:30 +0000 (22:48 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 14 Sep 2023 20:48:30 +0000 (22:48 +0200)
sweeprolog.el

index 9adaab8bf913941069eaa8a7b8e195b6bab814be..ada99c51bfd37f89d8939dc807d24f9eaf409567 100644 (file)
@@ -3281,10 +3281,11 @@ GOAL.  Otherwise, GOAL is set to a default value specified by
   (setq sweeprolog-top-level-timer (run-with-idle-timer 0.2 t #'sweeprolog-colourise-query (current-buffer)))
   (add-hook 'kill-buffer-hook
             (lambda ()
-              (condition-case _
-                  (sweeprolog-top-level-signal (current-buffer)
-                                               "thread_exit(0)")
-                (prolog-exception nil)))
+              (when (process-live-p (get-buffer-process (current-buffer)))
+                (condition-case _
+                    (sweeprolog-top-level-signal (current-buffer)
+                                                 "thread_exit(0)")
+                  (prolog-exception nil))))
             nil t)
   (add-hook 'kill-buffer-hook
             (lambda ()