]> git.eshelyaron.com Git - sweep.git/commitdiff
FIXED: Don't change hooks globally
authorEshel Yaron <me@eshelyaron.com>
Thu, 8 Jun 2023 17:37:13 +0000 (20:37 +0300)
committerEshel Yaron <me@eshelyaron.com>
Thu, 8 Jun 2023 17:37:13 +0000 (20:37 +0300)
* sweeprolog.el (sweeprolog-mode): Extend 'kill-buffer-hook' and
'context-menu-functions' locally rather than global.

sweeprolog.el

index 1f22c932604cca585f59d89816a314db34266b4a..e7b0a4f588cfa45850a3a3a4617fb01adb046ac6 100644 (file)
@@ -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))))