From f1b136eea8293e1d5914f921159bb639bcb850bf Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Thu, 10 Nov 2022 20:01:52 +0200 Subject: [PATCH] Catch error in kill-buffer-hook when top-level thread is dead --- sweeprolog.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 () -- 2.39.2