]> git.eshelyaron.com Git - emacs.git/commitdiff
(tooltip-mouse-motions-active): New variable.
authorRichard M. Stallman <rms@gnu.org>
Wed, 29 May 2002 16:38:06 +0000 (16:38 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 29 May 2002 16:38:06 +0000 (16:38 +0000)
(tooltip-activate-mouse-motions): Don't kill track-mouse local
if it was not made by us.

lisp/tooltip.el

index 7bdc5320626c2924d7b9f91bbbd014886bdd3511..79504156b64b42d0e116faad45829cf1f1bcea0d 100644 (file)
@@ -299,16 +299,21 @@ With ARG, turn tooltip mode on if and only if ARG is positive."
          (tooltip-activate-mouse-motions nil))
        (setq buffers (cdr buffers))))))
 
+(defvar tooltip-mouse-motions-active nil
+  "Locally t in a buffer if tooltip processing of mouse motion is enabled.")
 
 (defun tooltip-activate-mouse-motions (activatep)
   "Activate/deactivate mouse motion events for the current buffer.
 ACTIVATEP non-nil means activate mouse motion events."
   (if activatep
       (progn
+       (make-local-variable 'tooltip-mouse-motions-active)
+       (setq tooltip-mouse-motions-active t)
        (make-local-variable 'track-mouse)
        (setq track-mouse t))
-    (kill-local-variable 'track-mouse)))
-
+    (when tooltip-mouse-motions-active
+      (kill-local-variable 'tooltip-mouse-motions-active)
+      (kill-local-variable 'track-mouse))))
 
 (defun tooltip-mouse-motion (event)
   "Command handler for mouse movement events in `global-map'."