comparison lisp/tooltip.el @ 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 ebc4fa4ef475
children ce0d438fe05e
comparison
equal deleted inserted replaced
45570:1739a350f81c 45571:04484b8dacdc
297 (memq major-mode tooltip-gud-modes)) 297 (memq major-mode tooltip-gud-modes))
298 (tooltip-activate-mouse-motions t) 298 (tooltip-activate-mouse-motions t)
299 (tooltip-activate-mouse-motions nil)) 299 (tooltip-activate-mouse-motions nil))
300 (setq buffers (cdr buffers)))))) 300 (setq buffers (cdr buffers))))))
301 301
302 (defvar tooltip-mouse-motions-active nil
303 "Locally t in a buffer if tooltip processing of mouse motion is enabled.")
302 304
303 (defun tooltip-activate-mouse-motions (activatep) 305 (defun tooltip-activate-mouse-motions (activatep)
304 "Activate/deactivate mouse motion events for the current buffer. 306 "Activate/deactivate mouse motion events for the current buffer.
305 ACTIVATEP non-nil means activate mouse motion events." 307 ACTIVATEP non-nil means activate mouse motion events."
306 (if activatep 308 (if activatep
307 (progn 309 (progn
310 (make-local-variable 'tooltip-mouse-motions-active)
311 (setq tooltip-mouse-motions-active t)
308 (make-local-variable 'track-mouse) 312 (make-local-variable 'track-mouse)
309 (setq track-mouse t)) 313 (setq track-mouse t))
310 (kill-local-variable 'track-mouse))) 314 (when tooltip-mouse-motions-active
311 315 (kill-local-variable 'tooltip-mouse-motions-active)
316 (kill-local-variable 'track-mouse))))
312 317
313 (defun tooltip-mouse-motion (event) 318 (defun tooltip-mouse-motion (event)
314 "Command handler for mouse movement events in `global-map'." 319 "Command handler for mouse movement events in `global-map'."
315 (interactive "e") 320 (interactive "e")
316 (tooltip-hide) 321 (tooltip-hide)