From 19423c532dc7124bd0c72422b9fb7685ce3b7e41 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Wed, 29 Oct 2008 12:10:20 +0000 Subject: Rename `tooltip-hook' to `tooltip-functions'. * tooltip.el (tooltip-functions): Rename from `tooltip-hook', to follow naming conventions for abnormal hooks. Doc fix. (tooltip-mode, tooltip-timeout): Use it. (tooltip-hook): New obsolete alias. (tooltip-help-tips): Doc fix. * progmodes/gud.el (gud-tooltip-mode): Use `tooltip-functions'. --- lisp/ChangeLog | 10 ++++++++++ lisp/progmodes/gud.el | 4 ++-- lisp/tooltip.el | 21 ++++++++++++--------- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 986c9a04704..08ef1d6a565 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2008-10-29 Juanma Barranquero + + * tooltip.el (tooltip-functions): Rename from `tooltip-hook', + to follow naming conventions for abnormal hooks. Doc fix. + (tooltip-mode, tooltip-timeout): Use it. + (tooltip-hook): New obsolete alias. + (tooltip-help-tips): Doc fix. + + * progmodes/gud.el (gud-tooltip-mode): Use `tooltip-functions'. + 2008-10-29 Ulrich Mueller * server.el (server-socket-dir): Use TMPDIR (default /tmp) instead diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index d41e568331b..09c5469f1eb 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -3249,11 +3249,11 @@ Treats actions as defuns." (progn (add-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode) (add-hook 'pre-command-hook 'tooltip-hide) - (add-hook 'tooltip-hook 'gud-tooltip-tips) + (add-hook 'tooltip-functions 'gud-tooltip-tips) (define-key global-map [mouse-movement] 'gud-tooltip-mouse-motion)) (unless tooltip-mode (remove-hook 'pre-command-hook 'tooltip-hide) (remove-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode) - (remove-hook 'tooltip-hook 'gud-tooltip-tips) + (remove-hook 'tooltip-functions 'gud-tooltip-tips) (define-key global-map [mouse-movement] 'ignore))) (gud-tooltip-activate-mouse-motions-if-enabled) (if (and gud-comint-buffer diff --git a/lisp/tooltip.el b/lisp/tooltip.el index c6509d997af..fd3f3934824 100644 --- a/lisp/tooltip.el +++ b/lisp/tooltip.el @@ -59,10 +59,10 @@ the help text in the echo area, and does not make a pop-up window." (if tooltip-mode (progn (add-hook 'pre-command-hook 'tooltip-hide) - (add-hook 'tooltip-hook 'tooltip-help-tips)) + (add-hook 'tooltip-functions '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)) + (remove-hook 'tooltip-functions 'tooltip-help-tips)) (setq show-help-function (if tooltip-mode 'tooltip-show-help 'tooltip-show-help-non-mode))) @@ -146,10 +146,14 @@ and enable `tooltip-mode'." ;;; Variables that are not customizable. -(defvar tooltip-hook nil +(defvar tooltip-functions nil "Functions to call to display tooltips. -Each function is called with one argument EVENT which is a copy of -the last mouse movement event that occurred.") +Each function is called with one argument EVENT which is a copy +of the last mouse movement event that occurred. If one of these +functions displays the tooltip, it should return non-nil and the +rest are not called.") + +(define-obsolete-variable-alias 'tooltip-hook 'tooltip-functions "23.1") (defvar tooltip-timeout-id nil "The id of the timeout started when Emacs becomes idle.") @@ -193,7 +197,7 @@ This might return nil if the event did not occur over a buffer." (defun tooltip-timeout (object) "Function called when timer with id `tooltip-timeout-id' fires." - (run-hook-with-args-until-success 'tooltip-hook + (run-hook-with-args-until-success 'tooltip-functions tooltip-last-mouse-motion-event)) @@ -337,7 +341,6 @@ the buffer of PROCESS." (setq tooltip-previous-message nil))) (t (message nil))))) - (defun tooltip-show-help (msg) "Function installed as `show-help-function'. @@ -360,8 +363,8 @@ 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 timer with id `tooltip-timeout-id' fires. +This is installed on the hook `tooltip-functions', which +is run when 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 tooltip-use-echo-area) -- cgit v1.2.1