From 2f0c2b1c379832708cb5faef2962b2fd22f3ee43 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Thu, 8 Jun 2023 20:37:13 +0300 Subject: [PATCH] FIXED: Don't change hooks globally * sweeprolog.el (sweeprolog-mode): Extend 'kill-buffer-hook' and 'context-menu-functions' locally rather than global. --- sweeprolog.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sweeprolog.el b/sweeprolog.el index 1f22c93..e7b0a4f 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -4446,14 +4446,15 @@ certain contexts to maintain conventional Prolog layout." (add-hook 'kill-buffer-hook (lambda () (when (timerp sweeprolog--timer) - (cancel-timer sweeprolog--timer))))) + (cancel-timer sweeprolog--timer))) + nil t)) (when sweeprolog-enable-cursor-sensor (add-hook 'sweeprolog-analyze-region-fragment-hook #'sweeprolog-analyze-fragment-variable nil t) (cursor-sensor-mode 1)) (when (boundp 'context-menu-functions) (add-hook 'context-menu-functions - #'sweeprolog-context-menu-function)) + #'sweeprolog-context-menu-function nil t)) (unless (member 'sweeprolog-hole yank-excluded-properties) (setq-local yank-excluded-properties (cons 'sweeprolog-hole yank-excluded-properties)))) -- 2.39.5