changeset 45571:04484b8dacdc

(tooltip-mouse-motions-active): New variable. (tooltip-activate-mouse-motions): Don't kill track-mouse local if it was not made by us.
author Richard M. Stallman <rms@gnu.org>
date Wed, 29 May 2002 16:38:06 +0000
parents 1739a350f81c
children 26228dbfd782
files lisp/tooltip.el
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/tooltip.el	Wed May 29 16:36:55 2002 +0000
+++ b/lisp/tooltip.el	Wed May 29 16:38:06 2002 +0000
@@ -299,16 +299,21 @@
 	  (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'."