]> code.delx.au - gnu-emacs/blobdiff - lisp/tooltip.el
Added checks that distinguish between cygwin and windows in some
[gnu-emacs] / lisp / tooltip.el
index 9e11ddac5fb477febe3cc1113ab8449d58dac71d..7fd5533639d0c681b375d9007fbcdc267a46c6c5 100644 (file)
@@ -1,4 +1,4 @@
-;;; tooltip.el --- Show tooltip windows
+;;; tooltip.el --- show tooltip windows
 
 ;; Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
 
@@ -47,7 +47,7 @@
 
 (defvar tooltip-mode)
 
-(defcustom tooltip-delay 1.0
+(defcustom tooltip-delay 0.7
   "Seconds to wait before displaying a tooltip the first time."
   :tag "Delay"
   :type 'number
@@ -69,7 +69,7 @@ Do so after `tooltip-short-delay'."
   :group 'tooltip)
 
 
-(defcustom tooltip-hide-delay 5
+(defcustom tooltip-hide-delay 10
   "Hide tooltips automatically after this many seconds."
   :tag "Hide delay"
   :type 'number
@@ -77,7 +77,7 @@ Do so after `tooltip-short-delay'."
 
 
 (defcustom tooltip-x-offset nil
-  "Specify an X offset, in pixels, for the display of tooltips.
+  "X offset, in pixels, for the display of tooltips.
 The offset is relative to the position of the mouse.  It must
 be chosen so that the tooltip window doesn't contain the mouse
 when it pops up.  If the value is nil, the default offset is 5
@@ -92,7 +92,7 @@ the value of `tooltip-x-offset' is ignored."
 
 
 (defcustom tooltip-y-offset nil
-  "Specify a Y offset, in pixels, for the display of tooltips.
+  "Y offset, in pixels, for the display of tooltips.
 The offset is relative to the position of the mouse.  It must
 be chosen so that the tooltip window doesn't contain the mouse
 when it pops up.  If the value is nil, the default offset is -10
@@ -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'."
@@ -538,7 +543,7 @@ MSG is either a help string to display, or nil to cancel the display."
 (defun tooltip-help-tips (event)
   "Hook function to display a help tooltip.
 This is installed on the hook `tooltip-hook', which is run when
-the the timer with ID `tooltip-timeout-id' fires.
+the timer with ID `tooltip-timeout-id' fires.
 Value is non-nil if this function handled the tip."
   (when (stringp tooltip-help-message)
     (tooltip-show tooltip-help-message)