Mercurial > emacs
annotate lisp/tooltip.el @ 40217:a1a8276c8da5
*** empty log message ***
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 23 Oct 2001 15:50:29 +0000 |
parents | 1dab42ecd751 |
children | 4139a35c785c |
rev | line source |
---|---|
25003 | 1 ;;; tooltip.el --- Show tooltip windows |
2 | |
35069
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
3 ;; Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc. |
25003 | 4 |
5 ;; Author: Gerd Moellmann <gerd@acm.org> | |
6 ;; Keywords: help c mouse tools | |
7 | |
8 ;; This file is part of GNU Emacs. | |
9 | |
10 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 ;; it under the terms of the GNU General Public License as published by | |
12 ;; the Free Software Foundation; either version 2, or (at your option) | |
13 ;; any later version. | |
14 | |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; You should have received a copy of the GNU General Public License | |
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
23 ;; Boston, MA 02111-1307, USA. | |
24 | |
25 ;;; Commentary: | |
26 | |
27 ;; Put into your `.emacs' | |
28 | |
29 ;; (require 'tooltip) | |
30 ;; (tooltip-mode 1) | |
31 | |
32 | |
33 | |
34 ;;; Code: | |
35 | |
36 (eval-when-compile | |
37 (require 'cl) | |
38 (require 'comint) | |
39 (require 'gud)) | |
40 | |
41 (provide 'tooltip) | |
42 | |
43 | |
44 ;;; Customizable settings | |
45 | |
46 (defgroup tooltip nil | |
47 "Customization group for the `tooltip' package." | |
48 :group 'help | |
37755
cf803b8f08ad
(tooltip) <defgroup>: Put it in `gud' group instead
Gerd Moellmann <gerd@gnu.org>
parents:
35401
diff
changeset
|
49 :group 'gud |
25003 | 50 :group 'mouse |
51 :group 'tools | |
25332
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
52 :version "21.1" |
25003 | 53 :tag "Tool Tips") |
54 | |
25332
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
55 (defvar tooltip-mode) |
25003 | 56 |
57 (defcustom tooltip-delay 1.0 | |
58 "Seconds to wait before displaying a tooltip the first time." | |
59 :tag "Delay" | |
60 :type 'number | |
61 :group 'tooltip) | |
62 | |
63 | |
64 (defcustom tooltip-short-delay 0.1 | |
65 "Seconds to wait between subsequent tooltips on different items." | |
66 :tag "Short delay" | |
67 :type 'number | |
68 :group 'tooltip) | |
69 | |
70 | |
71 (defcustom tooltip-recent-seconds 1 | |
25332
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
72 "Display tooltips if changing tip items within this many seconds. |
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
73 Do so after `tooltip-short-delay'." |
25003 | 74 :tag "Recent seconds" |
75 :type 'number | |
76 :group 'tooltip) | |
77 | |
78 | |
35401
c00e94a506a2
(tooltip-hide-delay): New user-option.
Gerd Moellmann <gerd@gnu.org>
parents:
35069
diff
changeset
|
79 (defcustom tooltip-hide-delay 5 |
c00e94a506a2
(tooltip-hide-delay): New user-option.
Gerd Moellmann <gerd@gnu.org>
parents:
35069
diff
changeset
|
80 "Hide tooltips automatically after this many seconds." |
c00e94a506a2
(tooltip-hide-delay): New user-option.
Gerd Moellmann <gerd@gnu.org>
parents:
35069
diff
changeset
|
81 :tag "Hide delay" |
c00e94a506a2
(tooltip-hide-delay): New user-option.
Gerd Moellmann <gerd@gnu.org>
parents:
35069
diff
changeset
|
82 :type 'number |
c00e94a506a2
(tooltip-hide-delay): New user-option.
Gerd Moellmann <gerd@gnu.org>
parents:
35069
diff
changeset
|
83 :group 'tooltip) |
c00e94a506a2
(tooltip-hide-delay): New user-option.
Gerd Moellmann <gerd@gnu.org>
parents:
35069
diff
changeset
|
84 |
c00e94a506a2
(tooltip-hide-delay): New user-option.
Gerd Moellmann <gerd@gnu.org>
parents:
35069
diff
changeset
|
85 |
33587
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
86 (defcustom tooltip-x-offset nil |
40173
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
87 "Specify an X offset, in pixels, for the display of tooltips. |
33587
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
88 The offset is relative to the position of the mouse. It must |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
89 be chosen so that the tooltip window doesn't contain the mouse |
40173
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
90 when it pops up. If the value is nil, the default offset is 5 |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
91 pixels. |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
92 |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
93 If `tooltip-frame-parameters' includes the `left' parameter, |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
94 the value of `tooltip-x-offset' is ignored." |
33587
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
95 :tag "X offset" |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
96 :type '(choice (const :tag "Default" nil) |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
97 (integer :tag "Offset" :value 1)) |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
98 :group 'tooltip) |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
99 |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
100 |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
101 (defcustom tooltip-y-offset nil |
40173
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
102 "Specify a Y offset, in pixels, for the display of tooltips. |
33587
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
103 The offset is relative to the position of the mouse. It must |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
104 be chosen so that the tooltip window doesn't contain the mouse |
40173
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
105 when it pops up. If the value is nil, the default offset is -10 |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
106 pixels. |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
107 |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
108 If `tooltip-frame-parameters' includes the `top' parameter, |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
109 the value of `tooltip-y-offset' is ignored." |
33587
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
110 :tag "Y offset" |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
111 :type '(choice (const :tag "Default" nil) |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
112 (integer :tag "Offset" :value 1)) |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
113 :group 'tooltip) |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
114 |
7d4c3fcd3421
(tooltip-x-offset, tooltip-y-offset): New user-options.
Gerd Moellmann <gerd@gnu.org>
parents:
33356
diff
changeset
|
115 |
25003 | 116 (defcustom tooltip-frame-parameters |
117 '((name . "tooltip") | |
118 (internal-border-width . 5) | |
119 (border-width . 1)) | |
40173
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
120 "Frame parameters used for tooltips. |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
121 |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
122 If `left' or `top' parameters are included, they specify the absolute |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
123 position to pop up the tooltip." |
25003 | 124 :type 'sexp |
125 :tag "Frame Parameters" | |
126 :group 'tooltip) | |
127 | |
128 | |
35043
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
129 (defface tooltip |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
130 '((((class color)) |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
131 (:background "lightyellow" :foreground "black")) |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
132 (t ())) |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
133 "Face for tooltips." |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
134 :group 'tooltip) |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
135 |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
136 |
25003 | 137 (defcustom tooltip-gud-tips-p nil |
27582
42b52d8b6703
(tooltip-gud-tips-p, tooltip-gud-toggle-dereference):
Dave Love <fx@gnu.org>
parents:
25332
diff
changeset
|
138 "*Non-nil means show tooltips in GUD sessions." |
25003 | 139 :type 'boolean |
140 :tag "GUD" | |
33140
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
141 :set #'(lambda (symbol on) |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
142 (setq tooltip-gud-tips-p on) |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
143 (if on (tooltip-gud-tips-setup))) |
25003 | 144 :group 'tooltip) |
145 | |
146 | |
147 (defcustom tooltip-gud-modes '(gud-mode c-mode c++-mode) | |
148 "List of modes for which to enable GUD tips." | |
149 :type 'sexp | |
150 :tag "GUD modes" | |
151 :group 'tooltip) | |
152 | |
30481 | 153 |
25003 | 154 (defcustom tooltip-gud-display |
155 '((eq (tooltip-event-buffer tooltip-gud-event) | |
156 (marker-buffer overlay-arrow-position))) | |
157 "List of forms determining where GUD tooltips are displayed. | |
158 | |
159 Forms in the list are combined with AND. The default is to display | |
160 only tooltips in the buffer containing the overlay arrow." | |
161 :type 'sexp | |
162 :tag "GUD buffers predicate" | |
163 :group 'tooltip) | |
164 | |
165 | |
32431
a35cc9700ff7
* tooltip.el (tooltip-use-echo-area): New user variable.
Sam Steingold <sds@gnu.org>
parents:
30481
diff
changeset
|
166 (defcustom tooltip-use-echo-area nil |
33923 | 167 "Use the echo area instead of tooltip frames. |
168 This is only relevant GUD display, since otherwise it is equivalent to | |
169 turning off Tooltip mode." | |
32431
a35cc9700ff7
* tooltip.el (tooltip-use-echo-area): New user variable.
Sam Steingold <sds@gnu.org>
parents:
30481
diff
changeset
|
170 :type 'boolean |
33925 | 171 :tag "Use echo area" |
32431
a35cc9700ff7
* tooltip.el (tooltip-use-echo-area): New user variable.
Sam Steingold <sds@gnu.org>
parents:
30481
diff
changeset
|
172 :group 'tooltip) |
a35cc9700ff7
* tooltip.el (tooltip-use-echo-area): New user variable.
Sam Steingold <sds@gnu.org>
parents:
30481
diff
changeset
|
173 |
25003 | 174 |
175 ;;; Variables that are not customizable. | |
176 | |
177 (defvar tooltip-hook nil | |
178 "Functions to call to display tooltips. | |
179 Each function is called with one argument EVENT which is a copy of | |
180 the last mouse movement event that occurred.") | |
181 | |
182 | |
183 (defvar tooltip-timeout-id nil | |
184 "The id of the timeout started when Emacs becomes idle.") | |
185 | |
186 | |
187 (defvar tooltip-last-mouse-motion-event nil | |
188 "A copy of the last mouse motion event seen.") | |
189 | |
190 | |
191 (defvar tooltip-hide-time nil | |
192 "Time when the last tooltip was hidden.") | |
193 | |
194 | |
195 (defvar tooltip-gud-debugger nil | |
196 "The debugger for which we show tooltips.") | |
197 | |
198 | |
199 | |
200 ;;; Event accessors | |
201 | |
202 (defun tooltip-event-buffer (event) | |
203 "Return the buffer over which event EVENT occurred. | |
204 This might return nil if the event did not occur over a buffer." | |
205 (let ((window (posn-window (event-end event)))) | |
206 (and window (window-buffer window)))) | |
207 | |
208 | |
209 | |
210 ;;; Switching tooltips on/off | |
211 | |
212 ;; We don't set track-mouse globally because this is a big redisplay | |
213 ;; problem in buffers having a pre-command-hook or such installed, | |
214 ;; which does a set-buffer, like the summary buffer of Gnus. Calling | |
215 ;; set-buffer prevents redisplay optimizations, so every mouse motion | |
216 ;; would be accompanied by a full redisplay. | |
217 | |
218 ;;;###autoload | |
219 (defun tooltip-mode (&optional arg) | |
220 "Mode for tooltip display. | |
221 With ARG, turn tooltip mode on if and only if ARG is positive." | |
222 (interactive "P") | |
34689
e045e0e60223
(tooltip-mode): Signal an error if x-show-tip
Gerd Moellmann <gerd@gnu.org>
parents:
34540
diff
changeset
|
223 (unless (fboundp 'x-show-tip) |
e045e0e60223
(tooltip-mode): Signal an error if x-show-tip
Gerd Moellmann <gerd@gnu.org>
parents:
34540
diff
changeset
|
224 (error "Sorry, tooltips are not yet available on this system")) |
25003 | 225 (let* ((on (if arg |
226 (> (prefix-numeric-value arg) 0) | |
227 (not tooltip-mode))) | |
228 (hook-fn (if on 'add-hook 'remove-hook))) | |
229 (setq tooltip-mode on) | |
230 (funcall hook-fn 'change-major-mode-hook 'tooltip-change-major-mode) | |
231 (tooltip-activate-mouse-motions-if-enabled) | |
232 (funcall hook-fn 'pre-command-hook 'tooltip-hide) | |
233 (funcall hook-fn 'tooltip-hook 'tooltip-gud-tips) | |
234 (funcall hook-fn 'tooltip-hook 'tooltip-help-tips) | |
235 (setq show-help-function (if on 'tooltip-show-help-function nil)) | |
236 ;; `ignore' is the default binding for mouse movements. | |
237 (define-key global-map [mouse-movement] | |
238 (if on 'tooltip-mouse-motion 'ignore)) | |
33140
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
239 (tooltip-gud-tips-setup))) |
25003 | 240 |
33140
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
241 (defun tooltip-gud-tips-setup () |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
242 "Setup debugger mode-hooks for tooltips." |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
243 (when (and tooltip-mode tooltip-gud-tips-p) |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
244 (global-set-key [S-mouse-3] 'tooltip-gud-toggle-dereference) |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
245 (add-hook 'gdb-mode-hook |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
246 #'(lambda () (setq tooltip-gud-debugger 'gdb))) |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
247 (add-hook 'sdb-mode-hook |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
248 #'(lambda () (setq tooltip-gud-debugger 'sdb))) |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
249 (add-hook 'dbx-mode-hook |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
250 #'(lambda () (setq tooltip-gud-debugger 'dbx))) |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
251 (add-hook 'xdb-mode-hook |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
252 #'(lambda () (setq tooltip-gud-debugger 'xdb))) |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
253 (add-hook 'perldb-mode-hook |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
254 #'(lambda () (setq tooltip-gud-debugger 'perldb))))) |
25003 | 255 |
256 ;;; Timeout for tooltip display | |
257 | |
258 (defun tooltip-delay () | |
259 "Return the delay in seconds for the next tooltip." | |
260 (let ((delay tooltip-delay) | |
30481 | 261 (now (float-time))) |
25003 | 262 (when (and tooltip-hide-time |
263 (< (- now tooltip-hide-time) tooltip-recent-seconds)) | |
264 (setq delay tooltip-short-delay)) | |
265 delay)) | |
266 | |
267 | |
35069
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
268 (defun tooltip-cancel-delayed-tip () |
25003 | 269 "Disable the tooltip timeout." |
270 (when tooltip-timeout-id | |
271 (disable-timeout tooltip-timeout-id) | |
272 (setq tooltip-timeout-id nil))) | |
273 | |
274 | |
35069
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
275 (defun tooltip-start-delayed-tip () |
25003 | 276 "Add a one-shot timeout to call function tooltip-timeout." |
277 (setq tooltip-timeout-id | |
278 (add-timeout (tooltip-delay) 'tooltip-timeout nil))) | |
279 | |
280 | |
281 (defun tooltip-timeout (object) | |
282 "Function called when timer with id tooltip-timeout-id fires." | |
283 (run-hook-with-args-until-success 'tooltip-hook | |
284 tooltip-last-mouse-motion-event)) | |
285 | |
286 | |
287 | |
288 ;;; Reacting on mouse movements | |
289 | |
290 (defun tooltip-change-major-mode () | |
291 "Function added to `change-major-mode-hook' when tooltip mode is on." | |
292 (add-hook 'post-command-hook 'tooltip-activate-mouse-motions-if-enabled)) | |
293 | |
294 | |
295 (defun tooltip-activate-mouse-motions-if-enabled () | |
296 "Reconsider for all buffers whether mouse motion events are desired." | |
297 (remove-hook 'post-command-hook 'tooltip-activate-mouse-motions-if-enabled) | |
298 (let ((buffers (buffer-list))) | |
299 (save-excursion | |
300 (while buffers | |
301 (set-buffer (car buffers)) | |
302 (if (and tooltip-mode | |
303 tooltip-gud-tips-p | |
304 (memq major-mode tooltip-gud-modes)) | |
305 (tooltip-activate-mouse-motions t) | |
306 (tooltip-activate-mouse-motions nil)) | |
307 (setq buffers (cdr buffers)))))) | |
308 | |
309 | |
310 (defun tooltip-activate-mouse-motions (activatep) | |
311 "Activate/deactivate mouse motion events for the current buffer. | |
312 ACTIVATEP non-nil means activate mouse motion events." | |
313 (if activatep | |
314 (progn | |
315 (make-local-variable 'track-mouse) | |
316 (setq track-mouse t)) | |
317 (kill-local-variable 'track-mouse))) | |
318 | |
319 | |
320 (defun tooltip-mouse-motion (event) | |
321 "Command handler for mouse movement events in `global-map'." | |
322 (interactive "e") | |
323 (tooltip-hide) | |
324 (when (car (mouse-pixel-position)) | |
325 (setq tooltip-last-mouse-motion-event (copy-sequence event)) | |
35069
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
326 (tooltip-start-delayed-tip))) |
25003 | 327 |
328 | |
329 | |
330 ;;; Displaying tips | |
331 | |
35043
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
332 (defun tooltip-set-param (alist key value) |
40178
1dab42ecd751
(tooltip-set-param): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents:
40173
diff
changeset
|
333 "Change the value of KEY in alist ALIST to VALUE. |
35043
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
334 If there's no association for KEY in ALIST, add one, otherwise |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
335 change the existing association. Value is the resulting alist." |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
336 (let ((param (assq key alist))) |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
337 (if (consp param) |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
338 (setcdr param value) |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
339 (push (cons key value) alist)) |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
340 alist)) |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
341 |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
342 |
25003 | 343 (defun tooltip-show (text) |
40173
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
344 "Show a tooltip window displaying TEXT. |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
345 |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
346 Text larger than `x-max-tooltip-size' (which see) is clipped. |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
347 |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
348 If the alist in `tooltip-frame-parameters' includes `left' and `top' |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
349 parameters, they determine the x and y position where the tooltip |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
350 is displayed. Otherwise, the tooltip pops at offsets specified by |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
351 `tooltip-x-offset' and `tooltip-y-offset' from the current mouse |
c4955867228d
(tooltip-x-offset, tooltip-y-offset): Mention in the
Eli Zaretskii <eliz@gnu.org>
parents:
37755
diff
changeset
|
352 position." |
32431
a35cc9700ff7
* tooltip.el (tooltip-use-echo-area): New user variable.
Sam Steingold <sds@gnu.org>
parents:
30481
diff
changeset
|
353 (if tooltip-use-echo-area |
a35cc9700ff7
* tooltip.el (tooltip-use-echo-area): New user variable.
Sam Steingold <sds@gnu.org>
parents:
30481
diff
changeset
|
354 (message "%s" text) |
34540
e1e4704de6ed
(tooltip-show): If an error is signaled in
Gerd Moellmann <gerd@gnu.org>
parents:
33925
diff
changeset
|
355 (condition-case error |
35043
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
356 (let ((params (copy-sequence tooltip-frame-parameters)) |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
357 (fg (face-attribute 'tooltip :foreground)) |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
358 (bg (face-attribute 'tooltip :background))) |
35069
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
359 (when (stringp fg) |
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
360 (setq params (tooltip-set-param params 'foreground-color fg)) |
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
361 (setq params (tooltip-set-param params 'border-color fg))) |
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
362 (when (stringp bg) |
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
363 (setq params (tooltip-set-param params 'background-color bg))) |
35043
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
364 (x-show-tip (propertize text 'face 'tooltip) |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
365 (selected-frame) |
35044 | 366 params |
35401
c00e94a506a2
(tooltip-hide-delay): New user-option.
Gerd Moellmann <gerd@gnu.org>
parents:
35069
diff
changeset
|
367 tooltip-hide-delay |
35043
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
368 tooltip-x-offset |
f7ca93e40e16
(tooltip-frame-parameters): Remove colors.
Gerd Moellmann <gerd@gnu.org>
parents:
34689
diff
changeset
|
369 tooltip-y-offset)) |
34540
e1e4704de6ed
(tooltip-show): If an error is signaled in
Gerd Moellmann <gerd@gnu.org>
parents:
33925
diff
changeset
|
370 (error |
e1e4704de6ed
(tooltip-show): If an error is signaled in
Gerd Moellmann <gerd@gnu.org>
parents:
33925
diff
changeset
|
371 (message "Error while displaying tooltip: %s" error) |
e1e4704de6ed
(tooltip-show): If an error is signaled in
Gerd Moellmann <gerd@gnu.org>
parents:
33925
diff
changeset
|
372 (sit-for 1) |
e1e4704de6ed
(tooltip-show): If an error is signaled in
Gerd Moellmann <gerd@gnu.org>
parents:
33925
diff
changeset
|
373 (message "%s" text))))) |
e1e4704de6ed
(tooltip-show): If an error is signaled in
Gerd Moellmann <gerd@gnu.org>
parents:
33925
diff
changeset
|
374 |
25003 | 375 |
376 (defun tooltip-hide (&optional ignored-arg) | |
377 "Hide a tooltip, if one is displayed. | |
378 Value is non-nil if tooltip was open." | |
35069
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
379 (tooltip-cancel-delayed-tip) |
25003 | 380 (when (x-hide-tip) |
30481 | 381 (setq tooltip-hide-time (float-time)))) |
25003 | 382 |
383 | |
384 | |
385 ;;; Debugger-related functions | |
386 | |
387 (defun tooltip-identifier-from-point (point) | |
388 "Extract the identifier at POINT, if any. | |
389 Value is nil if no identifier exists at point. Identifier extraction | |
390 is based on the current syntax table." | |
391 (save-excursion | |
392 (goto-char point) | |
393 (let ((start (progn (skip-syntax-backward "w_") (point)))) | |
394 (unless (looking-at "[0-9]") | |
395 (skip-syntax-forward "w_") | |
396 (when (> (point) start) | |
397 (buffer-substring start (point))))))) | |
398 | |
399 | |
400 (defmacro tooltip-region-active-p () | |
401 "Value is non-nil if the region is currently active." | |
402 (if (string-match "^GNU" (emacs-version)) | |
403 `(and transient-mark-mode mark-active) | |
404 `(region-active-p))) | |
405 | |
406 | |
407 (defun tooltip-expr-to-print (event) | |
408 "Return an expression that should be printed for EVENT. | |
409 If a region is active and the mouse is inside the region, print | |
410 the region. Otherwise, figure out the identifier around the point | |
411 where the mouse is." | |
412 (save-excursion | |
413 (set-buffer (tooltip-event-buffer event)) | |
414 (let ((point (posn-point (event-end event)))) | |
415 (if (tooltip-region-active-p) | |
416 (when (and (<= (region-beginning) point) (<= point (region-end))) | |
417 (buffer-substring (region-beginning) (region-end))) | |
418 (tooltip-identifier-from-point point))))) | |
419 | |
420 | |
421 (defun tooltip-process-prompt-regexp (process) | |
422 "Return regexp matching the prompt of PROCESS at the end of a string. | |
423 The prompt is taken from the value of COMINT-PROMPT-REGEXP in the buffer | |
424 of PROCESS." | |
425 (let ((prompt-regexp (save-excursion | |
426 (set-buffer (process-buffer process)) | |
427 comint-prompt-regexp))) | |
428 ;; Most start with `^' but the one for `sdb' cannot be easily | |
429 ;; stripped. Code the prompt for `sdb' fixed here. | |
430 (if (= (aref prompt-regexp 0) ?^) | |
431 (setq prompt-regexp (substring prompt-regexp 1)) | |
432 (setq prompt-regexp "\\*")) | |
433 (concat "\n*" prompt-regexp "$"))) | |
434 | |
435 | |
436 (defun tooltip-strip-prompt (process output) | |
437 "Return OUTPUT with any prompt of PROCESS stripped from its end." | |
438 (let ((prompt-regexp (tooltip-process-prompt-regexp process))) | |
439 (save-match-data | |
440 (when (string-match prompt-regexp output) | |
441 (setq output (substring output 0 (match-beginning 0))))) | |
442 output)) | |
443 | |
444 | |
445 | |
446 ;;; Tips for `gud' | |
447 | |
448 (defvar tooltip-gud-original-filter nil | |
449 "Process filter to restore after GUD output has been received.") | |
450 | |
451 | |
452 (defvar tooltip-gud-dereference nil | |
453 "Non-nil means print expressions with a `*' in front of them. | |
454 For C this would dereference a pointer expression.") | |
455 | |
456 | |
457 (defvar tooltip-gud-event nil | |
458 "The mouse movement event that led to a tooltip display. | |
459 This event can be examined by forms in TOOLTIP-GUD-DISPLAY.") | |
460 | |
461 | |
462 (defvar tooltip-gud-debugger nil | |
463 "A symbol describing the debugger running under GUD.") | |
464 | |
465 | |
466 (defun tooltip-gud-toggle-dereference () | |
27582
42b52d8b6703
(tooltip-gud-tips-p, tooltip-gud-toggle-dereference):
Dave Love <fx@gnu.org>
parents:
25332
diff
changeset
|
467 "Toggle whether tooltips should show `* expr' or `expr'." |
25003 | 468 (interactive) |
469 (setq tooltip-gud-dereference (not tooltip-gud-dereference)) | |
470 (when (interactive-p) | |
471 (message "Dereferencing is now %s." | |
472 (if tooltip-gud-dereference "on" "off")))) | |
473 | |
474 | |
475 (defun tooltip-gud-process-output (process output) | |
476 "Process debugger output and show it in a tooltip window." | |
477 (set-process-filter process tooltip-gud-original-filter) | |
478 (tooltip-show (tooltip-strip-prompt process output))) | |
479 | |
480 | |
481 (defun tooltip-gud-print-command (expr) | |
482 "Return a suitable command to print the expression EXPR. | |
483 If TOOLTIP-GUD-DEREFERENCE is t, also prepend a `*' to EXPR." | |
484 (when tooltip-gud-dereference | |
485 (setq expr (concat "*" expr))) | |
486 (case tooltip-gud-debugger | |
487 ((gdb dbx) (concat "print " expr)) | |
488 (xdb (concat "p " expr)) | |
489 (sdb (concat expr "/")) | |
490 (perldb expr))) | |
30481 | 491 |
25003 | 492 |
493 (defun tooltip-gud-tips (event) | |
25332
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
494 "Show tip for identifier or selection under the mouse. |
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
495 The mouse must either point at an identifier or inside a selected |
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
496 region for the tip window to be shown. If tooltip-gud-dereference is t, |
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
497 add a `*' in front of the printed expression. |
25003 | 498 |
499 This function must return nil if it doesn't handle EVENT." | |
500 (let (gud-buffer process) | |
501 (when (and (eventp event) | |
502 tooltip-gud-tips-p | |
503 (boundp 'gud-comint-buffer) | |
504 (setq gud-buffer gud-comint-buffer) | |
505 (setq process (get-buffer-process gud-buffer)) | |
506 (posn-point (event-end event)) | |
507 (progn (setq tooltip-gud-event event) | |
508 (eval (cons 'and tooltip-gud-display)))) | |
509 (let ((expr (tooltip-expr-to-print event))) | |
510 (when expr | |
33140
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
511 (let ((cmd (tooltip-gud-print-command expr))) |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
512 (unless (null cmd) ; CMD can be nil if unknown debugger |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
513 (setq tooltip-gud-original-filter (process-filter process)) |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
514 (set-process-filter process 'tooltip-gud-process-output) |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
515 (gud-basic-call cmd) |
61f4c87b845c
(tooltip-gud-tips-setup): New function.
Miles Bader <miles@gnu.org>
parents:
32431
diff
changeset
|
516 expr))))))) |
25003 | 517 |
518 | |
519 ;;; Tooltip help. | |
520 | |
521 (defvar tooltip-help-message nil | |
522 "The last help message received via `tooltip-show-help-function'.") | |
523 | |
524 | |
525 (defun tooltip-show-help-function (msg) | |
526 "Function installed as `show-help-function'. | |
527 MSG is either a help string to display, or nil to cancel the display." | |
528 (let ((previous-help tooltip-help-message)) | |
529 (setq tooltip-help-message msg) | |
530 (cond ((null msg) | |
35069
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
531 ;; Cancel display. This also cancels a delayed tip, if |
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
532 ;; there is one. |
25003 | 533 (tooltip-hide)) |
35069
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
534 ((equal previous-help msg) |
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
535 ;; Same help as before (but possibly the mouse has moved). |
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
536 ;; Keep what we have. |
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
537 ) |
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
538 (t |
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
539 ;; A different help. Remove a previous tooltip, and |
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
540 ;; display a new one, with some delay. |
25003 | 541 (tooltip-hide) |
35069
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
542 (tooltip-start-delayed-tip))))) |
25003 | 543 |
544 | |
545 (defun tooltip-help-tips (event) | |
546 "Hook function to display a help tooltip. | |
35069
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
547 This is installed on the hook `tooltip-hook', which is run when |
d19eadb47c76
(tooltip-cancel-delayed-tip)
Gerd Moellmann <gerd@gnu.org>
parents:
35044
diff
changeset
|
548 the the timer with ID `tooltip-timeout-id' fires. |
25003 | 549 Value is non-nil if this function handled the tip." |
550 (when (stringp tooltip-help-message) | |
551 (tooltip-show tooltip-help-message) | |
552 t)) | |
553 | |
554 | |
555 | |
33356
73a360d50e18
(tooltip-mode): Add a comment about startup.el
Gerd Moellmann <gerd@gnu.org>
parents:
33140
diff
changeset
|
556 ;;; Do this after all functions have been defined that are called from |
73a360d50e18
(tooltip-mode): Add a comment about startup.el
Gerd Moellmann <gerd@gnu.org>
parents:
33140
diff
changeset
|
557 ;;; `tooltip-mode'. The actual default value of `tooltip-mode' is set |
73a360d50e18
(tooltip-mode): Add a comment about startup.el
Gerd Moellmann <gerd@gnu.org>
parents:
33140
diff
changeset
|
558 ;;; in startup.el. |
25332
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
559 |
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
560 ;;;###autoload |
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
561 (defcustom tooltip-mode nil |
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
562 "Toggle tooltip-mode. |
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
563 Setting this variable directly does not take effect; |
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
564 use either \\[customize] or the function `tooltip-mode'." |
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
565 :set (lambda (symbol value) |
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
566 (tooltip-mode (or value 0))) |
c09e05be2f4b
(tooltip-mode): Customize this, per convention.
Dave Love <fx@gnu.org>
parents:
25003
diff
changeset
|
567 :initialize 'custom-initialize-default |
25003 | 568 :type 'boolean |
569 :require 'tooltip | |
570 :group 'tooltip) | |
571 | |
572 | |
573 ;;; tooltip.el ends here |