]> git.eshelyaron.com Git - dict.git/commitdiff
Catch error in kill-buffer-hook when top-level thread is dead
authorEshel Yaron <me@eshelyaron.com>
Thu, 10 Nov 2022 18:01:52 +0000 (20:01 +0200)
committerEshel Yaron <me@eshelyaron.com>
Thu, 10 Nov 2022 18:01:52 +0000 (20:01 +0200)
sweeprolog.el

index be207afd3116f1f22b40ffce231af4be810d0ffc..6d8b2074cfa99218a02156840809fb682de85ae7 100644 (file)
@@ -2175,8 +2175,10 @@ Interactively, a prefix arg means to prompt for BUFFER."
   (setq sweeprolog-top-level-timer (run-with-idle-timer 0.2 t #'sweeprolog-colourise-query (current-buffer)))
   (add-hook 'kill-buffer-hook
             (lambda ()
-              (sweeprolog-top-level-signal (current-buffer)
-                                           "thread_exit(0)"))
+              (condition-case _
+                  (sweeprolog-top-level-signal (current-buffer)
+                                               "thread_exit(0)")
+                (prolog-exception nil)))
             nil t)
   (add-hook 'kill-buffer-hook
             (lambda ()