summaryrefslogtreecommitdiff
path: root/lisp/tooltip.el
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2005-12-10 21:28:59 +0000
committerNick Roberts <nickrob@snap.net.nz>2005-12-10 21:28:59 +0000
commite85dcd95a2fca764578d21d1b7f9a5fb24327161 (patch)
tree43ada446951c2d11ee01fe13679516bcc51c4452 /lisp/tooltip.el
parent35cd2d87b75febce9d9507b74061f32e64d17bd1 (diff)
downloademacs-e85dcd95a2fca764578d21d1b7f9a5fb24327161.tar.gz
(tooltip-mode): Move to start of file so that it
appears at top of customize buffer.
Diffstat (limited to 'lisp/tooltip.el')
-rw-r--r--lisp/tooltip.el59
1 files changed, 29 insertions, 30 deletions
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index 50715cf800c..451ca389013 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -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 @@ This might return nil if the event did not occur over a buffer."
(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