138
|
1 ;;; Balloon help for XEmacs (requires 19.15 or later)
|
98
|
2 ;;; Copyright (C) 1995, 1997 Kyle E. Jones
|
0
|
3 ;;;
|
|
4 ;;; This program is free software; you can redistribute it and/or modify
|
|
5 ;;; it under the terms of the GNU General Public License as published by
|
|
6 ;;; the Free Software Foundation; either version 1, or (at your option)
|
|
7 ;;; any later version.
|
|
8 ;;;
|
|
9 ;;; This program is distributed in the hope that it will be useful,
|
|
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12 ;;; GNU General Public License for more details.
|
|
13 ;;;
|
|
14 ;;; A copy of the GNU General Public License can be obtained from this
|
|
15 ;;; program's author (send electronic mail to kyle@uunet.uu.net) or from
|
|
16 ;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
|
|
17 ;;; 02139, USA.
|
|
18 ;;;
|
|
19 ;;; Send bug reports to kyle@wonderworks.com
|
|
20
|
|
21 ;; Balloon help pops up a small frame to display help text
|
|
22 ;; relating to objects that the mouse cursor passes over.
|
|
23 ;;
|
|
24 ;; Installation:
|
|
25 ;;
|
|
26 ;; Byte-compile the file balloon-help.el (with M-x byte-compile-file)
|
|
27 ;; and put the .elc file in a directory in your load-path. Add the
|
|
28 ;; following line to your .emacs:
|
|
29 ;;
|
|
30 ;; (require 'balloon-help)
|
138
|
31 ;; (balloon-help-mode 1)
|
0
|
32 ;;
|
138
|
33 ;; The balloon-help frame is a transient window that is not
|
|
34 ;; normally decorated by window managers, so the following
|
|
35 ;; window manager directives may not be needed. But if they
|
|
36 ;; are:
|
0
|
37 ;;
|
138
|
38 ;; For ol[v]wm use this in .Xdefaults:
|
|
39 ;; olvwm.NoDecor: balloon-help
|
|
40 ;; or
|
|
41 ;; olwm.MinimalDecor: balloon-help
|
0
|
42 ;;
|
138
|
43 ;; For fvvm version 1 use this in your .fvwmrc:
|
|
44 ;; NoTitle balloon-help
|
|
45 ;; or
|
|
46 ;; Style "balloon-help" NoTitle, NoHandles, BorderWidth 0
|
0
|
47 ;;
|
138
|
48 ;; For twm use this in your .twmrc:
|
|
49 ;; NoTitle { "balloon-help" }
|
|
50 ;;
|
0
|
51
|
|
52 (provide 'balloon-help)
|
|
53
|
138
|
54 (require 'custom)
|
|
55
|
|
56 (defgroup balloon-help nil
|
|
57 "Balloon-help support in XEmacs"
|
|
58 :group 'frames)
|
|
59
|
|
60 (defvar balloon-help-version "1.06"
|
0
|
61 "Version string for Balloon Help.")
|
|
62
|
138
|
63 (defvar balloon-help-mode nil
|
0
|
64 "*Non-nil means Balloon help mode is enabled.")
|
|
65
|
138
|
66 (defcustom balloon-help-timeout 1500
|
|
67 "*Display help after this many milliseconds of mouse inactivity."
|
|
68 :type 'integer
|
|
69 :group 'balloon-help)
|
0
|
70
|
138
|
71 (defcustom balloon-help-foreground "black"
|
|
72 "*The foreground color for displaying balloon help text."
|
|
73 :type 'string
|
|
74 :group 'balloon-help)
|
0
|
75
|
138
|
76 (defcustom balloon-help-background "gray80"
|
|
77 "*The background color for the balloon help frame."
|
|
78 :type 'string
|
|
79 :group 'balloon-help)
|
0
|
80
|
138
|
81 (defcustom balloon-help-background-pixmap ""
|
|
82 "*The background pixmap for the balloon help frame."
|
|
83 :type 'string
|
|
84 :group 'balloon-help)
|
0
|
85
|
138
|
86 (defcustom balloon-help-font "variable"
|
|
87 "*The font for displaying balloon help text."
|
|
88 :type 'string
|
|
89 :group 'balloon-help)
|
0
|
90
|
138
|
91 (defcustom balloon-help-border-color "black"
|
|
92 "*The color for displaying balloon help frame's border."
|
|
93 :type 'string
|
|
94 :group 'balloon-help)
|
0
|
95
|
138
|
96 (defcustom balloon-help-border-width 1
|
|
97 "*The width of the balloon help frame's border."
|
|
98 :type 'integer
|
|
99 :group 'balloon-help)
|
102
|
100
|
138
|
101 (defcustom balloon-help-use-sound nil
|
0
|
102 "*Non-nil value means play a sound to herald the appearance
|
|
103 and disappearance of the help frame.
|
|
104
|
|
105 `balloon-help-appears' will be played when the frame appears.
|
|
106 `balloon-help-disappears' will be played when the frame disappears.
|
|
107
|
|
108 See the documentation for the function load-sound-file to see how
|
138
|
109 define sounds."
|
|
110 :type 'boolean
|
|
111 :group 'balloon-help)
|
0
|
112
|
138
|
113 (defcustom balloon-help-frame-name "balloon-help"
|
|
114 "*The frame name to use for the frame to display the balloon help."
|
|
115 :type 'string
|
|
116 :group 'balloon-help)
|
0
|
117
|
138
|
118 (defcustom balloon-help-aggressively-follow-mouse nil
|
98
|
119 "*Non-nil means the balloon should move with the mouse even if the mouse
|
138
|
120 is over the same object as the last mouse motion event."
|
|
121 :type 'boolean
|
|
122 :group 'balloon-help)
|
98
|
123
|
0
|
124 ;;;
|
|
125 ;;; End of user variables.
|
|
126 ;;;
|
|
127
|
|
128 (defvar mouse-motion-hook mouse-motion-handler
|
|
129 "Hooks to be run whenever the user moves the mouse.
|
138
|
130 Each hook is called with one argument, the mouse motion event.
|
|
131 This hooks variable does not exist unless the \"balloon-help\" library
|
|
132 has been loaded.")
|
0
|
133
|
|
134 (defun mouse-motion-hook (event)
|
|
135 "Run the hooks attached to mouse-motion-hook."
|
|
136 (run-hook-with-args 'mouse-motion-hook event))
|
|
137
|
|
138 (setq mouse-motion-handler 'mouse-motion-hook)
|
|
139
|
|
140 (defvar balloon-help-frame nil
|
|
141 "Balloon help is displayed in this frame.")
|
|
142
|
138
|
143 (defvar balloon-help-junk-frame nil
|
|
144 "Junk parent frame of balloon-help-frame.")
|
|
145
|
0
|
146 (defvar balloon-help-help-object nil
|
|
147 "Object that the mouse is over that has a help property, nil otherwise.")
|
|
148
|
|
149 (defvar balloon-help-help-object-x nil
|
|
150 "Last horizontal mouse position over balloon-help-help-object.")
|
|
151
|
|
152 (defvar balloon-help-help-object-y nil
|
|
153 "Last vertical mouse position over balloon-help-help-object.")
|
|
154
|
138
|
155 (defvar balloon-help-buffer (get-buffer-create " *balloon-help*")
|
0
|
156 "Buffer used to display balloon help.")
|
|
157
|
|
158 (defvar balloon-help-timeout-id nil
|
|
159 "Timeout id for the balloon help timeout.")
|
|
160
|
|
161 (defvar balloon-help-display-pending nil
|
|
162 "Non-nil value means the help frame will be visible as soon
|
|
163 as the X server gets around to displaying it. Nil means it
|
|
164 will be invisible as soon as the X server decides to hide it.")
|
|
165
|
|
166 (defun balloon-help-mode (&optional arg)
|
|
167 "Toggle Balloon Help mode.
|
|
168 With arg, turn Balloon Help mode on iff arg is positive.
|
|
169
|
|
170 With Balloon Help enabled, a small frame is displayed whenever
|
|
171 the mouse rests on an object that has a help property of some
|
|
172 kind. The text of that help property is displayed in the frame.
|
|
173
|
|
174 For extents, the 'balloon-help' property is
|
|
175 checked.
|
|
176
|
|
177 For toolbar buttons, the help-string slot of the toolbar button
|
|
178 is checked.
|
|
179
|
|
180 If the value is a string, it is used as the help message.
|
|
181
|
|
182 If the property's value is a symbol, it is assumed to be the name
|
|
183 of a function and it will be called with one argument, the object
|
|
184 under the mouse, and the return value of that function will be
|
|
185 used as the help message."
|
|
186 (interactive "P")
|
|
187 (setq balloon-help-mode (or (and arg (> (prefix-numeric-value arg) 0))
|
|
188 (and (null arg) (null balloon-help-mode))))
|
|
189 (if (null balloon-help-mode)
|
|
190 (balloon-help-undisplay-help)))
|
|
191
|
|
192 (defun balloon-help-displayed ()
|
|
193 (and (frame-live-p balloon-help-frame)
|
138
|
194 (frame-visible-p balloon-help-frame)
|
|
195 (eq (frame-device balloon-help-frame) (selected-device))))
|
|
196
|
|
197 (defun balloon-help (&optional event)
|
|
198 "Display Balloon Help for the object under EVENT.
|
|
199 If EVENT is nil, then point in the selected window is used instead.
|
|
200 See the documentation for balloon-help-mode to find out what this means.
|
|
201 This command must be bound to a mouse event."
|
|
202 (interactive "e")
|
|
203 (unless (device-on-window-system-p)
|
|
204 (error "Cannot display balloon help on %s device" (device-type)))
|
|
205 (let ((balloon-help-mode t))
|
|
206 (balloon-help-motion-hook event))
|
|
207 (when balloon-help-timeout-id
|
|
208 (disable-timeout balloon-help-timeout-id)
|
|
209 (setq balloon-help-timeout-id nil))
|
|
210 (balloon-help-display-help))
|
0
|
211
|
|
212 (defun balloon-help-motion-hook (event)
|
|
213 (cond
|
|
214 ((null balloon-help-mode) t)
|
|
215 (t
|
138
|
216 (let* ((buffer (if event (event-buffer event) (current-buffer)))
|
|
217 (frame (if event (event-frame event) (selected-frame)))
|
|
218 (point (if event (event-point event) (point)))
|
|
219 (modeline-point (if event (event-modeline-position event)))
|
114
|
220 (modeline-extent (and modeline-point
|
|
221 (map-extents
|
|
222 (function (lambda (e ignored) e))
|
|
223 (symbol-value-in-buffer
|
|
224 'generated-modeline-string
|
|
225 buffer)
|
|
226 modeline-point modeline-point
|
|
227 nil nil
|
|
228 'balloon-help)))
|
138
|
229 (glyph-extent (and event (event-glyph-extent event)))
|
0
|
230 (glyph-extent (if (and glyph-extent
|
|
231 (extent-property glyph-extent
|
|
232 'balloon-help))
|
|
233 glyph-extent))
|
|
234 (extent (and point
|
|
235 (extent-at point buffer 'balloon-help)))
|
138
|
236 (button (and event (event-toolbar-button event)))
|
0
|
237 (button (if (and button (toolbar-button-help-string button))
|
|
238 button
|
|
239 nil))
|
114
|
240 (object (or modeline-extent glyph-extent extent button))
|
0
|
241 (id balloon-help-timeout-id))
|
|
242 (if (null object)
|
|
243 (if (and balloon-help-frame
|
|
244 (not (eq frame balloon-help-frame)))
|
|
245 (progn
|
|
246 (setq balloon-help-help-object nil)
|
138
|
247 (when id
|
|
248 (disable-timeout id)
|
|
249 (setq balloon-help-timeout-id nil))
|
0
|
250 (if (balloon-help-displayed)
|
|
251 (balloon-help-undisplay-help))))
|
|
252 (let* ((params (frame-parameters frame))
|
|
253 (top (cdr (assq 'top params)))
|
|
254 (left (cdr (assq 'left params)))
|
|
255 (xtop-toolbar-height
|
102
|
256 (if (and (specifier-instance top-toolbar-visible-p frame)
|
|
257 (specifier-instance top-toolbar frame))
|
|
258 (specifier-instance top-toolbar-height frame)
|
0
|
259 0))
|
|
260 (xleft-toolbar-width
|
102
|
261 (if (and (specifier-instance left-toolbar-visible-p frame)
|
|
262 (specifier-instance left-toolbar frame))
|
|
263 (specifier-instance left-toolbar-width frame)
|
0
|
264 0))
|
102
|
265 (menubar-height
|
|
266 (if (and buffer
|
|
267 (specifier-instance menubar-visible-p)
|
|
268 (save-excursion (set-buffer buffer) current-menubar))
|
|
269 22 0)))
|
0
|
270 (setq balloon-help-help-object-x
|
138
|
271 (if event
|
|
272 (+ left xleft-toolbar-width
|
|
273 (event-x-pixel event))
|
|
274 (/ (* (device-pixel-width) 2) 5))
|
0
|
275 balloon-help-help-object-y
|
138
|
276 (if event
|
|
277 (+ top xtop-toolbar-height menubar-height
|
|
278 (event-y-pixel event))
|
|
279 (/ (* (device-pixel-height) 2) 5))))
|
0
|
280 (cond ((eq frame balloon-help-frame) t)
|
|
281 ((eq object balloon-help-help-object)
|
98
|
282 (if (and (balloon-help-displayed)
|
|
283 balloon-help-aggressively-follow-mouse)
|
0
|
284 (balloon-help-move-help-frame)))
|
|
285 ((balloon-help-displayed)
|
|
286 (setq balloon-help-help-object object)
|
|
287 (balloon-help-display-help))
|
|
288 (t
|
|
289 (setq balloon-help-help-object object)
|
|
290 (if id
|
|
291 (disable-timeout id))
|
|
292 (setq balloon-help-timeout-id
|
|
293 (add-timeout (/ balloon-help-timeout 1000.0)
|
|
294 (function balloon-help-display-help)
|
|
295 nil)))))))))
|
|
296
|
|
297 (defun balloon-help-display-help (&rest ignored)
|
|
298 (setq balloon-help-timeout-id nil)
|
138
|
299 (if (and balloon-help-help-object (device-on-window-system-p))
|
0
|
300 (let* ((object balloon-help-help-object)
|
|
301 (help (or (and (extent-live-p object)
|
|
302 (extent-property object 'balloon-help))
|
|
303 (and (toolbar-button-p object)
|
|
304 (toolbar-button-help-string object))
|
|
305 (and (stringp object) object))))
|
|
306 ;; if help is non-null and is not a string, run it as
|
|
307 ;; function to produuce the help string.
|
|
308 (if (or (null help) (not (symbolp help)))
|
|
309 nil
|
|
310 (condition-case data
|
|
311 (setq help (funcall help object))
|
|
312 (error
|
|
313 (setq help (format "help function signaled: %S" data)))))
|
|
314 (if (stringp help)
|
|
315 (save-excursion
|
138
|
316 (if (or (not (frame-live-p balloon-help-frame))
|
|
317 (not (eq (selected-device)
|
|
318 (frame-device balloon-help-frame))))
|
0
|
319 (setq balloon-help-frame (balloon-help-make-help-frame)))
|
|
320 (set-buffer balloon-help-buffer)
|
|
321 (erase-buffer)
|
|
322 (insert help)
|
|
323 (if (not (bolp))
|
|
324 (insert ?\n))
|
138
|
325 ;;; ;; help strings longer than 2 lines have the last
|
|
326 ;;; ;; line stolen by the minibuffer, so make sure the
|
|
327 ;;; ;; last line is blank. Make the top line blank for
|
|
328 ;;; ;; some symmetry.
|
|
329 ;;; (if (< 2 (count-lines (point-min) (point-max)))
|
|
330 ;;; (progn
|
|
331 ;;; (insert ?\n)
|
|
332 ;;; ;; add a second blank line at the end to
|
|
333 ;;; ;; prevent the modeline bar from clipping the
|
|
334 ;;; ;; descenders of the last line of text.
|
|
335 ;;; (insert ?\n)
|
|
336 ;;; (goto-char (point-min))
|
|
337 ;;; (insert ?\n)))
|
|
338 ;; indent everything by a space for readability
|
0
|
339 (indent-rigidly (point-min) (point-max) 1)
|
138
|
340 (balloon-help-set-frame-properties)
|
|
341 (balloon-help-resize-help-frame)
|
0
|
342 (balloon-help-move-help-frame)
|
|
343 (balloon-help-expose-help-frame))))))
|
|
344
|
|
345 (defun balloon-help-undisplay-help ()
|
|
346 (balloon-help-hide-help-frame))
|
|
347
|
|
348 (defun balloon-help-hide-help-frame ()
|
|
349 (if (balloon-help-displayed)
|
|
350 (progn
|
|
351 (make-frame-invisible balloon-help-frame)
|
|
352 (if (and balloon-help-use-sound balloon-help-display-pending)
|
|
353 (play-sound 'balloon-help-disappears))
|
|
354 (setq balloon-help-display-pending nil))))
|
|
355
|
|
356 (defun balloon-help-expose-help-frame ()
|
|
357 (if (not (balloon-help-displayed))
|
|
358 (progn
|
|
359 (make-frame-visible balloon-help-frame)
|
|
360 (if (and balloon-help-use-sound (null balloon-help-display-pending))
|
|
361 (play-sound 'balloon-help-appears))
|
|
362 (setq balloon-help-display-pending t))))
|
|
363
|
138
|
364 (defun balloon-help-set-frame-properties ()
|
|
365 (let ((frame balloon-help-frame))
|
|
366 ;; don't set the font unconditionally because it makes the
|
|
367 ;; frame size flap visibly while XEmacs figures out the new
|
|
368 ;; frame size.
|
|
369 (if (not (equal (face-font 'default frame) balloon-help-font))
|
|
370 (set-face-font 'default balloon-help-font frame))
|
|
371 (set-face-foreground 'default balloon-help-foreground frame)
|
|
372 (set-face-background 'default balloon-help-background frame)
|
|
373 (set-face-background 'modeline balloon-help-background frame)
|
|
374 (set-face-background-pixmap 'default balloon-help-background-pixmap frame)
|
|
375 (set-frame-property frame 'border-color balloon-help-border-color)
|
|
376 (set-frame-property frame 'border-width balloon-help-border-width)))
|
|
377
|
|
378 ;;;(defun balloon-help-resize-help-frame ()
|
|
379 ;;; (save-excursion
|
|
380 ;;; (set-buffer balloon-help-buffer)
|
|
381 ;;; (let ((longest 0)
|
|
382 ;;; (lines 0)
|
|
383 ;;; (done nil)
|
|
384 ;;; (window-min-height 1)
|
|
385 ;;; (window-min-width 1))
|
|
386 ;;; (goto-char (point-min))
|
|
387 ;;; (while (not done)
|
|
388 ;;; (end-of-line)
|
|
389 ;;; (setq longest (max longest (current-column))
|
|
390 ;;; done (not (= 0 (forward-line))))
|
|
391 ;;; (and (not done) (setq lines (1+ lines))))
|
|
392 ;;; (set-frame-size balloon-help-frame (+ 1 longest) lines))))
|
|
393
|
0
|
394 (defun balloon-help-resize-help-frame ()
|
|
395 (save-excursion
|
|
396 (set-buffer balloon-help-buffer)
|
138
|
397 (let* ((longest 0)
|
|
398 (lines 0)
|
|
399 (done nil)
|
|
400 (inst (vector 'string ':data nil))
|
|
401 (window (frame-selected-window balloon-help-frame))
|
|
402 (font-width (font-width (face-font 'default) balloon-help-frame))
|
|
403 start width
|
|
404 (window-min-height 1)
|
|
405 (window-min-width 1))
|
0
|
406 (goto-char (point-min))
|
|
407 (while (not done)
|
138
|
408 (setq start (point))
|
0
|
409 (end-of-line)
|
138
|
410 (aset inst 2 (buffer-substring start (point)))
|
|
411 (setq longest (max longest (glyph-width (make-glyph inst) window))
|
0
|
412 done (not (= 0 (forward-line))))
|
|
413 (and (not done) (setq lines (1+ lines))))
|
138
|
414 (setq width (/ longest font-width)
|
|
415 width (if (> longest (* width font-width)) (1+ width) width))
|
|
416 (set-frame-size balloon-help-frame (+ 0 width) lines))))
|
|
417
|
|
418 (defun balloon-help-compute-help-frame-y-location ()
|
|
419 (let* ((device-bottom (device-pixel-height
|
|
420 (frame-device balloon-help-frame)))
|
|
421 (y-pos (max 0 (+ 48 balloon-help-help-object-y)))
|
|
422 (height (frame-pixel-height balloon-help-frame))
|
|
423 (bottom (+ y-pos height)))
|
|
424 (if (>= bottom device-bottom)
|
|
425 (setq y-pos (max 0 (- y-pos (- bottom device-bottom)))))
|
|
426 y-pos ))
|
|
427
|
|
428 (defun balloon-help-compute-help-frame-x-location ()
|
|
429 (let* ((device-right (device-pixel-width (frame-device balloon-help-frame)))
|
|
430 (x-pos (max 0 (+ 32 balloon-help-help-object-x)))
|
|
431 (width (frame-pixel-width balloon-help-frame))
|
|
432 (right (+ x-pos width)))
|
|
433 (if (>= right device-right)
|
|
434 (setq x-pos (max 0 (- x-pos (- right device-right)))))
|
|
435 x-pos ))
|
|
436
|
|
437 (defun balloon-help-move-help-frame ()
|
|
438 (let ((x (balloon-help-compute-help-frame-x-location))
|
|
439 (y (balloon-help-compute-help-frame-y-location)))
|
|
440 (set-frame-position balloon-help-frame x y)))
|
0
|
441
|
102
|
442 (defun balloon-help-make-junk-frame ()
|
|
443 (let ((window-min-height 1)
|
|
444 (window-min-width 1))
|
138
|
445 (when (framep balloon-help-junk-frame)
|
|
446 (delete-frame balloon-help-junk-frame)
|
|
447 (setq balloon-help-junk-frame nil))
|
|
448 (prog1
|
|
449 (setq balloon-help-junk-frame
|
|
450 (make-frame '(minibuffer t
|
|
451 initially-unmapped t
|
|
452 width 1
|
|
453 height 1)))
|
|
454 (set-window-buffer (frame-selected-window balloon-help-junk-frame)
|
|
455 balloon-help-buffer))))
|
102
|
456
|
0
|
457 (defun balloon-help-make-help-frame ()
|
138
|
458 (when (framep balloon-help-frame)
|
|
459 (delete-frame balloon-help-frame)
|
|
460 (setq balloon-help-frame nil))
|
0
|
461 (save-excursion
|
|
462 (set-buffer balloon-help-buffer)
|
138
|
463 (setq truncate-lines t)
|
0
|
464 (set-buffer-menubar nil)
|
|
465 (let* ((x (balloon-help-compute-help-frame-x-location))
|
|
466 (y (balloon-help-compute-help-frame-y-location))
|
|
467 (window-min-height 1)
|
|
468 (window-min-width 1)
|
138
|
469 (junk-frame (balloon-help-make-junk-frame))
|
0
|
470 (frame (make-frame (list
|
|
471 '(initially-unmapped . t)
|
|
472 ;; try to evade frame decorations
|
138
|
473 (cons 'name balloon-help-frame-name)
|
102
|
474 (cons 'border-width balloon-help-border-width)
|
0
|
475 (cons 'border-color balloon-help-border-color)
|
|
476 (cons 'top y)
|
|
477 (cons 'left x)
|
138
|
478 (cons 'popup junk-frame)
|
|
479 (cons 'minibuffer
|
|
480 (minibuffer-window junk-frame))
|
0
|
481 '(width . 3)
|
|
482 '(height . 1)))))
|
|
483 (set-face-font 'default balloon-help-font frame)
|
|
484 (set-face-foreground 'default balloon-help-foreground frame)
|
|
485 (set-face-background 'default balloon-help-background frame)
|
|
486 (set-face-background-pixmap 'default balloon-help-background-pixmap
|
|
487 frame)
|
|
488 (set-window-buffer (frame-selected-window frame) balloon-help-buffer)
|
|
489 (set-specifier has-modeline-p (cons frame nil))
|
|
490 (set-specifier top-toolbar-height (cons frame 0))
|
|
491 (set-specifier left-toolbar-width (cons frame 0))
|
|
492 (set-specifier right-toolbar-width (cons frame 0))
|
|
493 (set-specifier bottom-toolbar-height (cons frame 0))
|
138
|
494 (set-specifier top-toolbar-visible-p (cons frame nil))
|
|
495 (set-specifier left-toolbar-visible-p (cons frame nil))
|
|
496 (set-specifier right-toolbar-visible-p (cons frame nil))
|
|
497 (set-specifier bottom-toolbar-visible-p (cons frame nil))
|
0
|
498 (set-specifier top-toolbar (cons frame nil))
|
|
499 (set-specifier left-toolbar (cons frame nil))
|
|
500 (set-specifier right-toolbar (cons frame nil))
|
|
501 (set-specifier bottom-toolbar (cons frame nil))
|
|
502 (set-specifier scrollbar-width (cons frame 0))
|
|
503 (set-specifier scrollbar-height (cons frame 0))
|
138
|
504 (set-specifier text-cursor-visible-p (cons frame nil))
|
|
505 (set-specifier has-modeline-p (cons frame nil))
|
0
|
506 (set-specifier modeline-shadow-thickness (cons frame 0))
|
138
|
507 (set-specifier (glyph-image truncation-glyph) [nothing] frame '(x))
|
0
|
508 (set-face-background 'modeline balloon-help-background frame)
|
|
509 frame )))
|
|
510
|
138
|
511 (defun balloon-help-pre-command-hook ()
|
|
512 (unless (eq this-command 'balloon-help)
|
|
513 (balloon-help-go-away)))
|
|
514
|
|
515 (defun balloon-help-go-away (&rest ignored)
|
|
516 (setq balloon-help-help-object nil)
|
|
517 (if (balloon-help-displayed)
|
|
518 (balloon-help-undisplay-help)))
|
0
|
519
|
138
|
520 (defun balloon-help-mouse-leave-frame-hook (&rest ignored)
|
|
521 (let* ((mouse (mouse-position))
|
|
522 (window (car mouse)))
|
|
523 (if (or (null window) (not (eq (window-frame window) balloon-help-frame)))
|
|
524 (balloon-help-go-away))))
|
0
|
525
|
138
|
526 ;; loses with ClickToFocus under fvwm
|
|
527 ;;(fset 'balloon-help-deselect-frame-hook 'balloon-help-go-away)
|
|
528 ;;(add-hook 'deselect-frame-hook 'balloon-help-deselect-frame-hook)
|
0
|
529
|
|
530 (add-hook 'mouse-motion-hook 'balloon-help-motion-hook)
|
138
|
531
|
0
|
532 (add-hook 'pre-command-hook 'balloon-help-pre-command-hook)
|
|
533 (add-hook 'mouse-leave-frame-hook 'balloon-help-mouse-leave-frame-hook)
|