diff options
| author | Juanma Barranquero | 2008-10-29 12:10:20 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2008-10-29 12:10:20 +0000 |
| commit | 19423c532dc7124bd0c72422b9fb7685ce3b7e41 (patch) | |
| tree | f4088c300cdcc930743e66e023db00e88a5cc7cc | |
| parent | 4414f58f6792dcfb662839435cfe48d3e51ca33b (diff) | |
| download | emacs-19423c532dc7124bd0c72422b9fb7685ce3b7e41.tar.gz emacs-19423c532dc7124bd0c72422b9fb7685ce3b7e41.zip | |
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'.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/progmodes/gud.el | 4 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2008-10-29 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * tooltip.el (tooltip-functions): Rename from `tooltip-hook', | ||
| 4 | to follow naming conventions for abnormal hooks. Doc fix. | ||
| 5 | (tooltip-mode, tooltip-timeout): Use it. | ||
| 6 | (tooltip-hook): New obsolete alias. | ||
| 7 | (tooltip-help-tips): Doc fix. | ||
| 8 | |||
| 9 | * progmodes/gud.el (gud-tooltip-mode): Use `tooltip-functions'. | ||
| 10 | |||
| 1 | 2008-10-29 Ulrich Mueller <ulm@gentoo.org> | 11 | 2008-10-29 Ulrich Mueller <ulm@gentoo.org> |
| 2 | 12 | ||
| 3 | * server.el (server-socket-dir): Use TMPDIR (default /tmp) instead | 13 | * 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." | |||
| 3249 | (progn | 3249 | (progn |
| 3250 | (add-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode) | 3250 | (add-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode) |
| 3251 | (add-hook 'pre-command-hook 'tooltip-hide) | 3251 | (add-hook 'pre-command-hook 'tooltip-hide) |
| 3252 | (add-hook 'tooltip-hook 'gud-tooltip-tips) | 3252 | (add-hook 'tooltip-functions 'gud-tooltip-tips) |
| 3253 | (define-key global-map [mouse-movement] 'gud-tooltip-mouse-motion)) | 3253 | (define-key global-map [mouse-movement] 'gud-tooltip-mouse-motion)) |
| 3254 | (unless tooltip-mode (remove-hook 'pre-command-hook 'tooltip-hide) | 3254 | (unless tooltip-mode (remove-hook 'pre-command-hook 'tooltip-hide) |
| 3255 | (remove-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode) | 3255 | (remove-hook 'change-major-mode-hook 'gud-tooltip-change-major-mode) |
| 3256 | (remove-hook 'tooltip-hook 'gud-tooltip-tips) | 3256 | (remove-hook 'tooltip-functions 'gud-tooltip-tips) |
| 3257 | (define-key global-map [mouse-movement] 'ignore))) | 3257 | (define-key global-map [mouse-movement] 'ignore))) |
| 3258 | (gud-tooltip-activate-mouse-motions-if-enabled) | 3258 | (gud-tooltip-activate-mouse-motions-if-enabled) |
| 3259 | (if (and gud-comint-buffer | 3259 | (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." | |||
| 59 | (if tooltip-mode | 59 | (if tooltip-mode |
| 60 | (progn | 60 | (progn |
| 61 | (add-hook 'pre-command-hook 'tooltip-hide) | 61 | (add-hook 'pre-command-hook 'tooltip-hide) |
| 62 | (add-hook 'tooltip-hook 'tooltip-help-tips)) | 62 | (add-hook 'tooltip-functions 'tooltip-help-tips)) |
| 63 | (unless (and (boundp 'gud-tooltip-mode) gud-tooltip-mode) | 63 | (unless (and (boundp 'gud-tooltip-mode) gud-tooltip-mode) |
| 64 | (remove-hook 'pre-command-hook 'tooltip-hide)) | 64 | (remove-hook 'pre-command-hook 'tooltip-hide)) |
| 65 | (remove-hook 'tooltip-hook 'tooltip-help-tips)) | 65 | (remove-hook 'tooltip-functions 'tooltip-help-tips)) |
| 66 | (setq show-help-function | 66 | (setq show-help-function |
| 67 | (if tooltip-mode 'tooltip-show-help 'tooltip-show-help-non-mode))) | 67 | (if tooltip-mode 'tooltip-show-help 'tooltip-show-help-non-mode))) |
| 68 | 68 | ||
| @@ -146,10 +146,14 @@ and enable `tooltip-mode'." | |||
| 146 | 146 | ||
| 147 | ;;; Variables that are not customizable. | 147 | ;;; Variables that are not customizable. |
| 148 | 148 | ||
| 149 | (defvar tooltip-hook nil | 149 | (defvar tooltip-functions nil |
| 150 | "Functions to call to display tooltips. | 150 | "Functions to call to display tooltips. |
| 151 | Each function is called with one argument EVENT which is a copy of | 151 | Each function is called with one argument EVENT which is a copy |
| 152 | the last mouse movement event that occurred.") | 152 | of the last mouse movement event that occurred. If one of these |
| 153 | functions displays the tooltip, it should return non-nil and the | ||
| 154 | rest are not called.") | ||
| 155 | |||
| 156 | (define-obsolete-variable-alias 'tooltip-hook 'tooltip-functions "23.1") | ||
| 153 | 157 | ||
| 154 | (defvar tooltip-timeout-id nil | 158 | (defvar tooltip-timeout-id nil |
| 155 | "The id of the timeout started when Emacs becomes idle.") | 159 | "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." | |||
| 193 | 197 | ||
| 194 | (defun tooltip-timeout (object) | 198 | (defun tooltip-timeout (object) |
| 195 | "Function called when timer with id `tooltip-timeout-id' fires." | 199 | "Function called when timer with id `tooltip-timeout-id' fires." |
| 196 | (run-hook-with-args-until-success 'tooltip-hook | 200 | (run-hook-with-args-until-success 'tooltip-functions |
| 197 | tooltip-last-mouse-motion-event)) | 201 | tooltip-last-mouse-motion-event)) |
| 198 | 202 | ||
| 199 | 203 | ||
| @@ -337,7 +341,6 @@ the buffer of PROCESS." | |||
| 337 | (setq tooltip-previous-message nil))) | 341 | (setq tooltip-previous-message nil))) |
| 338 | (t | 342 | (t |
| 339 | (message nil))))) | 343 | (message nil))))) |
| 340 | |||
| 341 | 344 | ||
| 342 | (defun tooltip-show-help (msg) | 345 | (defun tooltip-show-help (msg) |
| 343 | "Function installed as `show-help-function'. | 346 | "Function installed as `show-help-function'. |
| @@ -360,8 +363,8 @@ MSG is either a help string to display, or nil to cancel the display." | |||
| 360 | 363 | ||
| 361 | (defun tooltip-help-tips (event) | 364 | (defun tooltip-help-tips (event) |
| 362 | "Hook function to display a help tooltip. | 365 | "Hook function to display a help tooltip. |
| 363 | This is installed on the hook `tooltip-hook', which is run when | 366 | This is installed on the hook `tooltip-functions', which |
| 364 | the timer with id `tooltip-timeout-id' fires. | 367 | is run when the timer with id `tooltip-timeout-id' fires. |
| 365 | Value is non-nil if this function handled the tip." | 368 | Value is non-nil if this function handled the tip." |
| 366 | (when (stringp tooltip-help-message) | 369 | (when (stringp tooltip-help-message) |
| 367 | (tooltip-show tooltip-help-message tooltip-use-echo-area) | 370 | (tooltip-show tooltip-help-message tooltip-use-echo-area) |