changeset 67485:2865d1195586

(tooltip-mode): Move to start of file so that it appears at top of customize buffer.
author Nick Roberts <nickrob@snap.net.nz>
date Sat, 10 Dec 2005 21:28:59 +0000
parents 9377c2eef2c4
children 3d94a55776e3
files lisp/tooltip.el
diffstat 1 files changed, 29 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/tooltip.el	Sat Dec 10 21:27:34 2005 +0000
+++ b/lisp/tooltip.el	Sat Dec 10 21:28:59 2005 +0000
@@ -30,6 +30,35 @@
 (defvar comint-prompt-regexp)
 
 ;;; Customizable settings
+;;; Switching tooltips on/off
+
+;; We don't set track-mouse globally because this is a big redisplay
+;; problem in buffers having a pre-command-hook or such installed,
+;; which does a set-buffer, like the summary buffer of Gnus.  Calling
+;; set-buffer prevents redisplay optimizations, so every mouse motion
+;; would be accompanied by a full redisplay.
+
+(define-minor-mode tooltip-mode
+  "Toggle Tooltip display.
+With ARG, turn tooltip mode on if and only if ARG is positive."
+  :global t
+  :init-value (not (or noninteractive
+		       emacs-basic-display
+		       (not (display-graphic-p))
+		       (not (fboundp 'x-show-tip))))
+  :initialize 'custom-initialize-safe-default
+  :group 'tooltip
+  (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
+    (error "Sorry, tooltips are not yet available on this system"))
+  (if tooltip-mode
+      (progn
+	(add-hook 'pre-command-hook 'tooltip-hide)
+	(add-hook 'tooltip-hook 'tooltip-help-tips))
+    (unless (and (boundp 'gud-tooltip-mode) gud-tooltip-mode)
+      (remove-hook 'pre-command-hook 'tooltip-hide))
+    (remove-hook 'tooltip-hook 'tooltip-help-tips))
+  (setq show-help-function
+	(if tooltip-mode 'tooltip-show-help nil)))
 
 (defgroup tooltip nil
   "Customization group for the `tooltip' package."
@@ -145,36 +174,6 @@
   (let ((window (posn-window (event-end event))))
     (and window (window-buffer window))))
 
-;;; Switching tooltips on/off
-
-;; We don't set track-mouse globally because this is a big redisplay
-;; problem in buffers having a pre-command-hook or such installed,
-;; which does a set-buffer, like the summary buffer of Gnus.  Calling
-;; set-buffer prevents redisplay optimizations, so every mouse motion
-;; would be accompanied by a full redisplay.
-
-(define-minor-mode tooltip-mode
-  "Toggle Tooltip display.
-With ARG, turn tooltip mode on if and only if ARG is positive."
-  :global t
-  :init-value (not (or noninteractive
-		       emacs-basic-display
-		       (not (display-graphic-p))
-		       (not (fboundp 'x-show-tip))))
-  :initialize 'custom-initialize-safe-default
-  :group 'tooltip
-  (unless (or (null tooltip-mode) (fboundp 'x-show-tip))
-    (error "Sorry, tooltips are not yet available on this system"))
-  (if tooltip-mode
-      (progn
-	(add-hook 'pre-command-hook 'tooltip-hide)
-	(add-hook 'tooltip-hook 'tooltip-help-tips))
-    (unless (and (boundp 'gud-tooltip-mode) gud-tooltip-mode)
-      (remove-hook 'pre-command-hook 'tooltip-hide))
-    (remove-hook 'tooltip-hook 'tooltip-help-tips))
-  (setq show-help-function
-	(if tooltip-mode 'tooltip-show-help nil)))
-
 
 ;;; Timeout for tooltip display