annotate lisp/packages/balloon-help.el @ 26:441bb1e64a06 r19-15b96

Import from CVS: tag r19-15b96
author cvs
date Mon, 13 Aug 2007 08:51:32 +0200
parents 8fc7fe29b841
children c53a95d3c46d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; Balloon help for XEmacs (requires 19.12 or later)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 0
diff changeset
2 ;;; Copyright (C) 1995, 1997 Kyle E. Jones
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;;; This program is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;;; the Free Software Foundation; either version 1, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;; This program is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; A copy of the GNU General Public License can be obtained from this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; program's author (send electronic mail to kyle@uunet.uu.net) or from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;; 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;; Send bug reports to kyle@wonderworks.com
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; Balloon help pops up a small frame to display help text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; relating to objects that the mouse cursor passes over.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; Installation:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; Byte-compile the file balloon-help.el (with M-x byte-compile-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; and put the .elc file in a directory in your load-path. Add the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; following line to your .emacs:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;; (require 'balloon-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; For 19.12 users:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; If you are using fvwm, [tv]twm or ol[v]wm, you can also add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; the following lines to various configuration file to use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; minimal decorations on the balloon help frames.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; In .emacs:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; (setq balloon-help-frame-name "balloon-help")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;; For ol[v]wm use this in .Xdefaults:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;; olvwm.NoDecor: balloon-help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;; or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; olwm.MinimalDecor: balloon-help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;; For fvvm use this in your .fvwmrc:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;; NoTitle balloon-help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;; or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;; Style "balloon-help" NoTitle, NoHandles, BorderWidth 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;; For twm use this in your .twmrc:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;; NoTitle { "balloon-help" }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;; Under 19.13 and later versions the balloon-help frame uses a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;; transient window that is not normally decorated by window
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;; managers. So the window manager directives should not be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;; needed for XEmacs 19.13 and beyond.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (provide 'balloon-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
60 (defvar balloon-help-version "1.04"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 "Version string for Balloon Help.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (defvar balloon-help-mode t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 "*Non-nil means Balloon help mode is enabled.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (defvar balloon-help-timeout 1500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 "*Display help after this many milliseconds of mouse inactivity.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (defvar balloon-help-foreground "black"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 "*The foreground color for displaying balloon help text.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (defvar balloon-help-background "rgb:c0/c0/c0"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 "*The background color for the balloon help frame.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (defvar balloon-help-background-pixmap ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 "*The background pixmap for the balloon help frame.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (defvar balloon-help-font "fixed"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 "*The font for displaying balloon help text.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (defvar balloon-help-border-color "black"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 "*The color for displaying balloon help frame's border.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
84 (defvar balloon-help-border-width 2
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
85 "*The width of the balloon help frame's border.")
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
86
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (defvar balloon-help-use-sound nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 "*Non-nil value means play a sound to herald the appearance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 and disappearance of the help frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 `balloon-help-appears' will be played when the frame appears.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 `balloon-help-disappears' will be played when the frame disappears.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 See the documentation for the function load-sound-file to see how
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 define sounds.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (defvar balloon-help-frame-name nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 "*The frame name to use for the frame to display the balloon help.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 0
diff changeset
100 (defvar balloon-help-aggressively-follow-mouse nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 0
diff changeset
101 "*Non-nil means the balloon should move with the mouse even if the mouse
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 0
diff changeset
102 is over the same object as the last mouse motion event.")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 0
diff changeset
103
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ;;; End of user variables.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (defvar mouse-motion-hook mouse-motion-handler
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 "Hooks to be run whenever the user moves the mouse.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 Each hook is called with one argument, the mouse motion event.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (defun mouse-motion-hook (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 "Run the hooks attached to mouse-motion-hook."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (run-hook-with-args 'mouse-motion-hook event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (setq mouse-motion-handler 'mouse-motion-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (defvar balloon-help-frame nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 "Balloon help is displayed in this frame.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (defvar balloon-help-help-object nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 "Object that the mouse is over that has a help property, nil otherwise.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (defvar balloon-help-help-object-x nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 "Last horizontal mouse position over balloon-help-help-object.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (defvar balloon-help-help-object-y nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 "Last vertical mouse position over balloon-help-help-object.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (defvar balloon-help-buffer nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 "Buffer used to display balloon help.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (defvar balloon-help-timeout-id nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 "Timeout id for the balloon help timeout.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (defvar balloon-help-display-pending nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 "Non-nil value means the help frame will be visible as soon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 as the X server gets around to displaying it. Nil means it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 will be invisible as soon as the X server decides to hide it.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (defvar balloon-help-bar-cursor nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (defun balloon-help-mode (&optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 "Toggle Balloon Help mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 With arg, turn Balloon Help mode on iff arg is positive.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 With Balloon Help enabled, a small frame is displayed whenever
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 the mouse rests on an object that has a help property of some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 kind. The text of that help property is displayed in the frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 For extents, the 'balloon-help' property is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 checked.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 For toolbar buttons, the help-string slot of the toolbar button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 is checked.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 If the value is a string, it is used as the help message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 If the property's value is a symbol, it is assumed to be the name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 of a function and it will be called with one argument, the object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 under the mouse, and the return value of that function will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 used as the help message."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (interactive "P")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (setq balloon-help-mode (or (and arg (> (prefix-numeric-value arg) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (and (null arg) (null balloon-help-mode))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (if (null balloon-help-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (balloon-help-undisplay-help)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (defun balloon-help-displayed ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (and (frame-live-p balloon-help-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (frame-visible-p balloon-help-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (defun balloon-help-motion-hook (event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ((null balloon-help-mode) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 ((button-press-event-p event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (setq balloon-help-help-object nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (if balloon-help-timeout-id
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (disable-timeout balloon-help-timeout-id))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (if (balloon-help-displayed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (balloon-help-undisplay-help)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (let* ((buffer (event-buffer event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (frame (event-frame event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (point (and buffer (event-point event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (glyph-extent (event-glyph-extent event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (glyph-extent (if (and glyph-extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (extent-property glyph-extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 'balloon-help))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 glyph-extent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (extent (and point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (extent-at point buffer 'balloon-help)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (button (event-toolbar-button event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (button (if (and button (toolbar-button-help-string button))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 button
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (object (or glyph-extent extent button))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (id balloon-help-timeout-id))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (if (null object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (if (and balloon-help-frame
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (not (eq frame balloon-help-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (setq balloon-help-help-object nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (if id
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (disable-timeout id))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (if (balloon-help-displayed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (balloon-help-undisplay-help))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (let* ((params (frame-parameters frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (top (cdr (assq 'top params)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (left (cdr (assq 'left params)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (xtop-toolbar-height
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
212 (if (and (specifier-instance top-toolbar-visible-p frame)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
213 (specifier-instance top-toolbar frame))
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
214 (specifier-instance top-toolbar-height frame)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (xleft-toolbar-width
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
217 (if (and (specifier-instance left-toolbar-visible-p frame)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
218 (specifier-instance left-toolbar frame))
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
219 (specifier-instance left-toolbar-width frame)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 0))
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
221 (menubar-height
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
222 (if (and buffer
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
223 (specifier-instance menubar-visible-p)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
224 (save-excursion (set-buffer buffer) current-menubar))
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
225 22 0)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (setq balloon-help-help-object-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (+ left xleft-toolbar-width (event-x-pixel event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 balloon-help-help-object-y
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (+ top xtop-toolbar-height menubar-height
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (event-y-pixel event))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (cond ((eq frame balloon-help-frame) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 ((eq object balloon-help-help-object)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 0
diff changeset
233 (if (and (balloon-help-displayed)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 0
diff changeset
234 balloon-help-aggressively-follow-mouse)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (balloon-help-move-help-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 ((balloon-help-displayed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (setq balloon-help-help-object object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (balloon-help-display-help))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (setq balloon-help-help-object object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (if id
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (disable-timeout id))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (setq balloon-help-timeout-id
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (add-timeout (/ balloon-help-timeout 1000.0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (function balloon-help-display-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 nil)))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (defun balloon-help-pre-command-hook (&rest ignored)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (setq balloon-help-help-object nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (if (balloon-help-displayed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (balloon-help-undisplay-help)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (fset 'balloon-help-post-command-hook 'balloon-help-pre-command-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (fset 'balloon-help-mouse-leave-frame-hook 'balloon-help-pre-command-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (fset 'balloon-help-deselect-frame-hook 'balloon-help-pre-command-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (defun balloon-help-display-help (&rest ignored)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (setq balloon-help-timeout-id nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (if balloon-help-help-object
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (let* ((object balloon-help-help-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (help (or (and (extent-live-p object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (extent-property object 'balloon-help))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (and (toolbar-button-p object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (toolbar-button-help-string object))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (and (stringp object) object))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 ;; if help is non-null and is not a string, run it as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 ;; function to produuce the help string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (if (or (null help) (not (symbolp help)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (condition-case data
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (setq help (funcall help object))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (setq help (format "help function signaled: %S" data)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (if (stringp help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (if (not (bufferp balloon-help-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (setq balloon-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (get-buffer-create " *balloon-help*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (if (not (frame-live-p balloon-help-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (setq balloon-help-frame (balloon-help-make-help-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (setq bar-cursor t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (set-buffer balloon-help-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (insert help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (if (not (bolp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (insert ?\n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 ;; help strings longer than 2 lines have the last
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 ;; line stolen by the minibuffer, so make sure the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 ;; last line is blank. Make the top line blank for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 ;; some symmetry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (if (< 2 (count-lines (point-min) (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (insert ?\n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 ;; add a second blank line at the end to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 ;; prevent the modeline bar from clipping the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 ;; descenders of the last line of text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (insert ?\n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (insert ?\n)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 ;; cursor will be at point-min because we're just
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 ;; moving point which doesn't affect window-point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 ;; when the window isn't selected. Indent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 ;; everything so that the cursor will be over a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 ;; space. The 1-pixel bar cursor will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 ;; completely invisible this way.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (indent-rigidly (point-min) (point-max) 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (balloon-help-move-help-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (balloon-help-resize-help-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (balloon-help-expose-help-frame))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (defun balloon-help-undisplay-help ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (setq bar-cursor balloon-help-bar-cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (balloon-help-hide-help-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (defun balloon-help-hide-help-frame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (if (balloon-help-displayed)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (make-frame-invisible balloon-help-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (if (and balloon-help-use-sound balloon-help-display-pending)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (play-sound 'balloon-help-disappears))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (setq balloon-help-display-pending nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (defun balloon-help-expose-help-frame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (if (not (balloon-help-displayed))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (make-frame-visible balloon-help-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (if (and balloon-help-use-sound (null balloon-help-display-pending))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (play-sound 'balloon-help-appears))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (setq balloon-help-display-pending t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 (defun balloon-help-resize-help-frame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (set-buffer balloon-help-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (let ((longest 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (lines 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (done nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (window-min-height 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (window-min-width 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (while (not done)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (setq longest (max longest (current-column))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 done (not (= 0 (forward-line))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (and (not done) (setq lines (1+ lines))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (set-frame-size balloon-help-frame (+ 1 longest) lines))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
347 (defun balloon-help-make-junk-frame ()
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
348 (let ((window-min-height 1)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
349 (window-min-width 1))
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
350 (make-frame '(minibuffer t initially-unmapped t width 1 height 1))))
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
351
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (defun balloon-help-make-help-frame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (setq balloon-help-bar-cursor bar-cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (set-buffer balloon-help-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (set-buffer-menubar nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (let* ((x (balloon-help-compute-help-frame-x-location))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (y (balloon-help-compute-help-frame-y-location))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (window-min-height 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (window-min-width 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (frame (make-frame (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 '(initially-unmapped . t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 ;; try to evade frame decorations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (cons 'name (or balloon-help-frame-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 "xclock"))
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
366 (cons 'border-width balloon-help-border-width)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (cons 'border-color balloon-help-border-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (cons 'top y)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (cons 'left x)
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
370 (cons 'popup (balloon-help-make-junk-frame))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 '(width . 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 '(height . 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (set-face-font 'default balloon-help-font frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (set-face-foreground 'default balloon-help-foreground frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (set-face-background 'default balloon-help-background frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (set-face-background-pixmap 'default balloon-help-background-pixmap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (set-window-buffer (frame-selected-window frame) balloon-help-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (set-specifier has-modeline-p (cons frame nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (set-specifier top-toolbar-height (cons frame 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (set-specifier left-toolbar-width (cons frame 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (set-specifier right-toolbar-width (cons frame 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (set-specifier bottom-toolbar-height (cons frame 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (set-specifier top-toolbar (cons frame nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (set-specifier left-toolbar (cons frame nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (set-specifier right-toolbar (cons frame nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (set-specifier bottom-toolbar (cons frame nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (set-specifier scrollbar-width (cons frame 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (set-specifier scrollbar-height (cons frame 0))
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
390 (and (boundp 'text-cursor-visible-p)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
391 (specifierp text-cursor-visible-p)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
392 (set-specifier text-cursor-visible-p (cons frame nil)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (set-specifier modeline-shadow-thickness (cons frame 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (set-face-background 'modeline balloon-help-background frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 frame )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (defun balloon-help-compute-help-frame-x-location ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (max 0 (+ 32 balloon-help-help-object-x)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (defun balloon-help-compute-help-frame-y-location ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (max 0 (+ 48 balloon-help-help-object-y)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 (defun balloon-help-move-help-frame ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 (let ((x (balloon-help-compute-help-frame-x-location))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (y (balloon-help-compute-help-frame-y-location)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (set-frame-position balloon-help-frame x y)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (add-hook 'mouse-motion-hook 'balloon-help-motion-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (add-hook 'pre-command-hook 'balloon-help-pre-command-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (add-hook 'post-command-hook 'balloon-help-post-command-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (add-hook 'mouse-leave-frame-hook 'balloon-help-mouse-leave-frame-hook)
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
412 ;; loses with ClickToFocus under fvwm
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 22
diff changeset
413 ;;(add-hook 'deselect-frame-hook 'balloon-help-deselect-frame-hook)