From: Eshel Yaron Date: Thu, 10 Nov 2022 18:01:52 +0000 (+0200) Subject: Catch error in kill-buffer-hook when top-level thread is dead X-Git-Tag: V8.5.20-sweep-0.8.5~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f1b136eea8293e1d5914f921159bb639bcb850bf;p=dict.git Catch error in kill-buffer-hook when top-level thread is dead --- diff --git a/sweeprolog.el b/sweeprolog.el index be207af..6d8b207 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -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 ()