Mercurial > emacs
annotate lispref/frames.texi @ 8057:11a0c2f22d7e
(beginning-of-buffer-other-window)
(end-of-buffer-other-window): New functions.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 25 Jun 1994 18:58:42 +0000 |
parents | ec7caebc4a1d |
children | bf6ecdddf78b |
rev | line source |
---|---|
6547 | 1 @c -*-texinfo-*- |
2 @c This is part of the GNU Emacs Lisp Reference Manual. | |
3 @c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. | |
4 @c See the file elisp.texi for copying conditions. | |
5 @setfilename ../info/frames | |
6 @node Frames, Positions, Windows, Top | |
7 @chapter Frames | |
8 @cindex frame | |
9 | |
10 A @var{frame} is a rectangle on the screen that contains one or more | |
11 Emacs windows. A frame initially contains a single main window (plus | |
12 perhaps a minibuffer window) which you can subdivide vertically or | |
13 horizontally into smaller windows. | |
14 | |
15 @cindex terminal frame | |
16 @cindex X window frame | |
17 When Emacs runs on a text-only terminal, it has just one frame, a | |
18 @dfn{terminal frame}. There is no way to create another terminal frame | |
19 after startup. If Emacs has an X display, it does not have a terminal | |
20 frame; instead, it starts with a single @dfn{X window frame}. You can | |
21 create more; see @ref{Creating Frames}. | |
22 | |
23 @defun framep object | |
24 This predicate returns @code{t} if @var{object} is a frame, and | |
25 @code{nil} otherwise. | |
26 @end defun | |
27 | |
28 @menu | |
29 * Creating Frames:: Creating additional X Window frames. | |
30 * Frame Parameters:: Controlling frame size, position, font, etc. | |
31 * Deleting Frames:: Frames last until explicitly deleted. | |
32 * Finding All Frames:: How to examine all existing frames. | |
33 * Frames and Windows:: A frame contains windows; | |
34 display of text always works through windows. | |
35 * Minibuffers and Frames:: How a frame finds the minibuffer to use. | |
36 * Input Focus:: Specifying the selected frame. | |
37 * Visibility of Frames:: Frames may be visible or invisible, or icons. | |
38 * Raising and Lowering:: Raising a frame makes it hide other X windows; | |
39 lowering it makes the others hide them. | |
40 * Frame Configurations:: Saving the state of all frames. | |
41 * Mouse Tracking:: Getting events that say when the mouse moves. | |
42 * Mouse Position:: Asking where the mouse is, or moving it. | |
43 * Pop-Up Menus:: Displaying a menu for the user to select from. | |
44 * Dialog Boxes:: Displaying a box to ask yes or no. | |
7684
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
45 * Pointer Shapes:: Specifying the shape of the mouse pointer. |
6547 | 46 * X Selections:: Transferring text to and from other X clients. |
47 * X Connections:: Opening and closing the X server connection. | |
48 * Resources:: Getting resource values from the server. | |
49 * Server Data:: Getting info about the X server. | |
50 @end menu | |
51 | |
52 @xref{Display}, for related information. | |
53 | |
54 @node Creating Frames | |
55 @section Creating Frames | |
56 | |
57 To create a new frame, call the function @code{make-frame}. | |
58 | |
59 @defun make-frame alist | |
60 This function creates a new frame, if the display mechanism permits | |
61 creation of frames. (An X server does; an ordinary terminal does not.) | |
62 | |
63 The argument is an alist specifying frame parameters. Any parameters | |
64 not mentioned in @var{alist} default according to the value of the | |
65 variable @code{default-frame-alist}; parameters not specified there | |
66 either default from the standard X defaults file and X resources. | |
67 | |
68 The set of possible parameters depends in principle on what kind of | |
69 window system Emacs uses to display its the frames. @xref{X Frame | |
70 Parameters}, for documentation of individual parameters you can specify | |
71 when creating an X window frame. | |
72 @end defun | |
73 | |
74 @defvar default-frame-alist | |
75 This is an alist specifying default values of frame parameters. | |
76 Each element has the form: | |
77 | |
78 @example | |
79 (@var{parameter} . @var{value}) | |
80 @end example | |
7684
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
81 @end defvar |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
82 |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
83 @defvar initial-frame-alist |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
84 This is an alist specifying frame parameters for the initial Emacs frame. |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
85 |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
86 Emacs creates the initial X frame before it reads the user's init file, |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
87 which is the first occasion that the user has to set this variable. So |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
88 after reading the init file, Emacs modifies the parameters according to |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
89 the value of this variable. In most cases, that is good enough. |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
90 However, for window position parameters, it may be inconvenient that the |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
91 window initially appears in the wrong place or the wrong size. The way |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
92 to overcome this annoyance is to specify the initial frame's geometry |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
93 with an X resource. |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
94 @end defvar |
6547 | 95 |
96 If you use options that specify window appearance when you invoke Emacs, | |
7684
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
97 they take effect by adding elements to @code{default-frame-alist}. One |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
98 exception is @samp{-geometry}, which adds to @code{initial-frame-alist} |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
99 instead. @xref{Command Arguments,,, emacs, The GNU Emacs Manual}. |
6547 | 100 |
101 @defvar before-make-frame-hook | |
102 A normal hook run by @code{make-frame} before it actually creates the | |
103 frame. | |
104 @end defvar | |
105 | |
106 @defvar after-make-frame-hook | |
107 A normal hook run by @code{make-frame} after it creates the frame. | |
108 @end defvar | |
109 | |
110 @node Frame Parameters | |
111 @section Frame Parameters | |
112 | |
113 A frame has many parameters that control its appearance and behavior. | |
114 Just what parameters a frame has depends on what display mechanism it | |
115 uses. | |
116 | |
117 Frame parameters exist for the sake of window systems. A terminal frame | |
118 has a few parameters, for compatibility's sake only. You can't change | |
119 these parameters directly; the only ones that ever change are the height | |
120 and width. | |
121 | |
122 @menu | |
123 * Parameter Access:: How to change a frame's parameters. | |
124 * Initial Parameters:: Specifying frame parameters when you make a frame. | |
125 * X Frame Parameters:: Individual parameters documented. | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
126 * Size and Position:: Changing the size and position of a frame. |
6547 | 127 @end menu |
128 | |
129 @node Parameter Access | |
130 @subsection Access to Frame Parameters | |
131 | |
132 These functions let you read and change the parameter values of a | |
133 frame. | |
134 | |
135 @defun frame-parameters frame | |
136 The function @code{frame-parameters} returns an alist listing all the | |
137 parameters of @var{frame} and their values. | |
138 @end defun | |
139 | |
140 @defun modify-frame-parameters frame alist | |
141 This function alters the parameters of frame @var{frame} based on the | |
142 elements of @var{alist}. Each element of @var{alist} has the form | |
143 @code{(@var{parm} . @var{value})}, where @var{parm} is a symbol naming a | |
144 parameter. If you don't mention a parameter in @var{alist}, its value | |
145 doesn't change. | |
146 @end defun | |
147 | |
148 @node Initial Parameters | |
149 @subsection Initial Frame Parameters | |
150 | |
151 You can specify the parameters for the initial startup frame | |
152 by setting @code{initial-frame-alist} in your @file{.emacs} file. | |
153 | |
154 @defvar initial-frame-alist | |
155 This variable's value is an alist of parameter values used when creating | |
156 the initial X window frame. | |
157 @end defvar | |
158 | |
159 If these parameters specify a separate minibuffer-only frame, | |
160 and you have not created one, Emacs creates one for you. | |
161 | |
162 @defvar minibuffer-frame-alist | |
163 This variable's value is an alist of parameter values used when creating | |
164 an initial minibuffer-only frame---if such a frame is needed, according | |
165 to the parameters for the main initial frame. | |
166 @end defvar | |
167 | |
168 @node X Frame Parameters | |
169 @subsection X Window Frame Parameters | |
170 | |
171 Just what parameters a frame has depends on what display mechanism it | |
172 uses. Here is a table of the parameters of an X window frame: | |
173 | |
174 @table @code | |
175 @item name | |
176 The name of the frame. Most window managers display the frame's name in | |
177 the frame's border, at the top of the frame. If you don't specify a | |
178 name, and you have more than one frame, Emacs sets the frame name based | |
179 on the buffer displayed in the frame's selected window. | |
180 | |
181 If you specify the frame name explicitly when you create the frame, the | |
182 name is also used (instead of the name of the Emacs executable) when | |
183 looking up X resources for the frame. | |
184 | |
185 @item left | |
7684
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
186 The screen position of the left edge, in pixels. The value may be |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
187 @code{-} instead of a number; that represents @samp{-0} in a geometry |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
188 specification. |
6547 | 189 |
190 @item top | |
7684
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
191 The screen position of the top edge, in pixels. The value may be |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
192 @code{-} instead of a number; that represents @samp{-0} in a geometry |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
193 specification. |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
194 |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
195 @item user-position |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
196 Non-@code{nil} if the screen position of the frame was explicitly |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
197 requested by the user (for example, with the @samp{-geometry} option). |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
198 Nothing automatically makes this parameter non-@code{nil}; it is up to |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
199 Lisp programs that call @code{make-frame} to specify this parameter as |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
200 well as specifying the @code{left} and @code{top} parameters. |
6547 | 201 |
202 @item height | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
203 The height of the frame contents, in characters. (To get the height in |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
204 pixels, call @code{frame-pixel-height}; see @ref{Size and Position}.) |
6547 | 205 |
206 @item width | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
207 The width of the frame contents, in characters. (To get the height in |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
208 pixels, call @code{frame-pixel-width}; see @ref{Size and Position}.) |
6547 | 209 |
210 @item window-id | |
211 The number of the X window for the frame. | |
212 | |
213 @item minibuffer | |
214 Whether this frame has its own minibuffer. The value @code{t} means | |
215 yes, @code{nil} means no, @code{only} means this frame is just a | |
216 minibuffer, a minibuffer window (in some other frame) means the new | |
217 frame uses that minibuffer. | |
218 | |
219 @item font | |
220 The name of the font for displaying text in the frame. This is a | |
221 string. | |
222 | |
223 @item auto-raise | |
224 Whether selecting the frame raises it (non-@code{nil} means yes). | |
225 | |
226 @item auto-lower | |
227 Whether deselecting the frame lowers it (non-@code{nil} means yes). | |
228 | |
229 @item vertical-scroll-bars | |
230 Whether the frame has scroll bars for vertical scrolling | |
231 (non-@code{nil} means yes). | |
232 | |
233 @item horizontal-scroll-bars | |
234 Whether the frame has scroll bars for horizontal scrolling | |
235 (non-@code{nil} means yes). (Horizontal scroll bars are not currently | |
236 implemented.) | |
237 | |
238 @item icon-type | |
239 The type of icon to use for this frame when it is iconified. | |
240 Non-@code{nil} specifies a bitmap icon, @code{nil} a text icon. | |
241 | |
242 @item foreground-color | |
243 The color to use for the inside of a character. This is a string; the X | |
244 server defines the meaningful color names. | |
245 | |
246 @item background-color | |
247 The color to use for the background of text. | |
248 | |
249 @item mouse-color | |
7684
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
250 The color for the mouse pointer. |
6547 | 251 |
252 @item cursor-color | |
253 The color for the cursor that shows point. | |
254 | |
255 @item border-color | |
256 The color for the border of the frame. | |
257 | |
258 @item cursor-type | |
259 The way to display the cursor. There are two legitimate values: | |
260 @code{bar} and @code{box}. The symbol @code{bar} specifies a vertical | |
261 bar between characters as the cursor. The symbol @code{box} specifies | |
262 an ordinary black box overlaying the character after point; that is the | |
263 default. | |
264 | |
265 @item border-width | |
266 The width in pixels of the window border. | |
267 | |
268 @item internal-border-width | |
269 The distance in pixels between text and border. | |
270 | |
271 @item unsplittable | |
272 If non-@code{nil}, this frame's window is never split automatically. | |
273 | |
274 @item visibility | |
275 The state of visibility of the frame. There are three possibilities: | |
276 @code{nil} for invisible, @code{t} for visible, and @code{icon} for | |
277 iconified. @xref{Visibility of Frames}. | |
278 | |
279 @item menu-bar-lines | |
280 The number of lines to allocate at the top of the frame for a menu bar. | |
281 The default is 1. @xref{Menu Bar}. | |
282 | |
283 @item parent-id | |
284 @c ??? Not yet working. | |
285 The X window number of the window that should be the parent of this one. | |
286 Specifying this lets you create an Emacs window inside some other | |
287 application's window. (It is not certain this will be implemented; try | |
288 it and see if it works.) | |
289 @end table | |
290 | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
291 @node Size and Position |
6547 | 292 @subsection Frame Size And Position |
293 | |
294 You can read or change the size and position of a frame using the | |
295 frame parameters @code{left}, @code{top}, @code{height} and | |
7684
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
296 @code{width}. Whatever geometry parameters you don't specify are chosen |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
297 by the window manager in its usual fashion. |
6547 | 298 |
299 Here are some special features for working with sizes and positions: | |
300 | |
301 @defun set-frame-position frame left top | |
302 This function sets the position of the top left corner of | |
303 @var{frame}---to @var{left} and @var{top}. These arguments are measured | |
304 in pixels, counting from the top left corner of the screen. | |
305 @end defun | |
306 | |
307 @defun frame-height &optional frame | |
308 @defunx frame-width &optional frame | |
309 These functions return the height and width of @var{frame}, measured in | |
310 characters. If you don't supply @var{frame}, they use the selected | |
311 frame. | |
312 @end defun | |
313 | |
314 @defun frame-pixel-height &optional frame | |
315 @defunx frame-pixel-width &optional frame | |
316 These functions return the height and width of @var{frame}, measured in | |
317 pixels. If you don't supply @var{frame}, they use the selected frame. | |
318 @end defun | |
319 | |
320 @defun frame-char-height &optional frame | |
321 @defunx frame-char-width &optional frame | |
322 These functions return the height and width, respectively, of a | |
323 character in @var{frame}, measured in pixels. The values depend on the | |
324 choice of font. If you don't supply @var{frame}, these functions use | |
325 the selected frame. | |
326 @end defun | |
327 | |
328 @defun set-frame-size frame cols rows | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
329 This function sets the size of @var{frame}, measured in characters; |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
330 @var{cols} and @var{rows} specify the new width and height. |
6547 | 331 |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
332 To set the size based on values measured in pixels, use |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
333 @code{frame-char-height} and @code{frame-char-width} to convert |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
334 them to units of characters. |
6547 | 335 @end defun |
336 | |
337 The old-fashioned functions @code{set-screen-height} and | |
338 @code{set-screen-width}, which were used to specify the height and width | |
339 of the screen in Emacs versions that did not support multiple frames, | |
340 are still usable. They apply to the selected frame. @xref{Screen | |
341 Size}. | |
342 | |
343 @defun x-parse-geometry geom | |
344 @cindex geometry specification | |
345 The function @code{x-parse-geometry} converts a standard X windows | |
346 geometry string to an alist which you can use as part of the argument to | |
347 @code{make-frame}. | |
348 | |
349 The alist describes which parameters were specified in @var{geom}, and | |
350 gives the values specified for them. Each element looks like | |
351 @code{(@var{parameter} . @var{value})}. The possible @var{parameter} | |
352 values are @code{left}, @code{top}, @code{width}, and @code{height}. | |
353 | |
354 @smallexample | |
355 (x-parse-geometry "35x70+0-0") | |
356 @result{} ((width . 35) (height . 70) (left . 0) (top . -1)) | |
357 @end smallexample | |
358 @end defun | |
359 | |
360 @ignore | |
361 New functions @code{set-frame-height} and @code{set-frame-width} set the | |
362 size of a specified frame. The frame is the first argument; the size is | |
363 the second. | |
364 @end ignore | |
365 | |
366 @node Deleting Frames | |
367 @section Deleting Frames | |
368 @cindex deletion of frames | |
369 | |
370 Frames remain potentially visible until you explicitly @dfn{delete} | |
371 them. A deleted frame cannot appear on the screen, but continues to | |
372 exist as a Lisp object until there are no references to it. There is no | |
373 way to cancel the deletion of a frame aside from restoring a saved frame | |
374 configuration (@pxref{Frame Configurations}); this is similar to the | |
375 way windows behave. | |
376 | |
377 @deffn Command delete-frame &optional frame | |
378 This function deletes the frame @var{frame}. By default, @var{frame} is | |
379 the selected frame. | |
380 @end deffn | |
381 | |
382 @defun frame-live-p frame | |
383 The function @code{frame-live-p} returns non-@code{nil} if the frame | |
384 @var{frame} has not been deleted. | |
385 @end defun | |
386 | |
387 @node Finding All Frames | |
388 @section Finding All Frames | |
389 | |
390 @defun frame-list | |
391 The function @code{frame-list} returns a list of all the frames that | |
392 have not been deleted. It is analogous to @code{buffer-list} for | |
393 buffers. The list that you get is newly created, so modifying the list | |
394 doesn't have any effect on the internals of Emacs. | |
395 @end defun | |
396 | |
397 @defun visible-frame-list | |
398 This function returns a list of just the currently visible frames. | |
399 @xref{Visibility of Frames}. | |
400 @end defun | |
401 | |
402 @defun next-frame &optional frame minibuf | |
403 The function @code{next-frame} lets you cycle conveniently through all | |
404 the frames from an arbitrary starting point. It returns the ``next'' | |
405 frame after @var{frame} in the cycle. If @var{frame} is omitted or | |
406 @code{nil}, it defaults to the selected frame. | |
407 | |
408 The second argument, @var{minibuf}, says which frames to consider: | |
409 | |
410 @table @asis | |
411 @item @code{nil} | |
412 Exclude minibuffer-only frames. | |
413 @item @code{visible} | |
414 Consider all visible frames. | |
415 @item a window | |
416 Consider only the frames using that particular window as their | |
417 minibuffer. | |
418 @item anything else | |
419 Consider all frames. | |
420 @end table | |
421 @end defun | |
422 | |
423 @defun previous-frame &optional frame minibuf | |
424 Like @code{next-frame}, but cycles through all frames in the opposite | |
425 direction. | |
426 @end defun | |
427 | |
428 @node Frames and Windows | |
429 @section Frames and Windows | |
430 | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
431 Each window is part of one and only one frame; you can get the frame |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
432 with @code{window-frame}. |
6547 | 433 |
434 @defun window-frame window | |
435 This function returns the frame that @var{window} is on. | |
436 @end defun | |
437 | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
438 All the non-minibuffer windows in a frame are arranged in a cyclic |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
439 order. The order runs from the frame's top window, which is at the |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
440 upper left corner, down and to the right, until it reaches the window at |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
441 the lower right corner (always the minibuffer window, if the frame has |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
442 one), and then it moves back to the top. |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
443 |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
444 @defun frame-top-window frame |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
445 This returns the topmost, leftmost window of frame @var{frame}. |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
446 This is a window |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
447 @end defun |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
448 |
6547 | 449 At any time, exactly one window on any frame is @dfn{selected within the |
450 frame}. The significance of this designation is that selecting the | |
451 frame also selects this window. You can get the frame's current | |
452 selected window with @code{frame-selected-window}. | |
453 | |
454 @defun frame-selected-window frame | |
455 This function returns the window on @var{frame} which is selected within | |
456 @var{frame}. | |
457 @end defun | |
458 | |
459 Conversely, selecting a window for Emacs with @code{select-window} also | |
460 makes that window selected within its frame. @xref{Selecting Windows}. | |
461 | |
462 @node Minibuffers and Frames | |
463 @section Minibuffers and Frames | |
464 | |
465 Normally, each frame has its own minibuffer window at the bottom, which | |
466 is used whenever that frame is selected. If the frame has a minibuffer, | |
467 you can get it with @code{minibuffer-window} (@pxref{Minibuffer Misc}). | |
468 | |
469 However, you can also create a frame with no minibuffer. Such a frame | |
470 must use the minibuffer window of some other frame. When you create the | |
471 frame, you can specify explicitly the frame on which to find the | |
472 minibuffer to use. If you don't, then the minibuffer is found in the | |
473 frame which is the value of the variable | |
474 @code{default-minibuffer-frame}. Its value should be a frame which does | |
475 have a minibuffer. | |
476 | |
477 If you use a minibuffer-only frame, you might want that frame to raise | |
478 when you enter the minibuffer. If so, set the variable | |
479 @code{minibuffer-auto-raise} to @code{t}. @xref{Raising and Lowering}. | |
480 | |
481 @node Input Focus | |
482 @section Input Focus | |
483 @cindex input focus | |
484 @cindex selected frame | |
485 | |
486 At any time, one frame in Emacs is the @dfn{selected frame}. The selected | |
487 window always resides on the selected frame. | |
488 | |
489 @defun selected-frame | |
490 This function returns the selected frame. | |
491 @end defun | |
492 | |
493 The X server normally directs keyboard input to the X window that the | |
494 mouse is in. Some window managers use mouse clicks or keyboard events | |
495 to @dfn{shift the focus} to various X windows, overriding the normal | |
496 behavior of the server. | |
497 | |
498 Lisp programs can switch frames ``temporarily'' by calling | |
499 the function @code{select-frame}. This does not override the window | |
500 manager; rather, it escapes from the window manager's control until | |
501 that control is somehow reasserted. | |
502 | |
503 @c ??? This is not yet implemented properly. | |
504 @defun select-frame frame | |
505 This function selects frame @var{frame}, temporarily disregarding the | |
506 focus of the X server. The selection of @var{frame} lasts until the | |
507 next time the user does something to select a different frame, or until | |
508 the next time this function is called. | |
509 @end defun | |
510 | |
511 Emacs cooperates with the X server and the window managers by arranging | |
512 to select frames according to what the server and window manager ask | |
513 for. It does so by generating a special kind of input event, called a | |
514 @dfn{focus} event. The command loop handles a focus event by calling | |
515 @code{handle-select-frame}. @xref{Focus Events}. | |
516 | |
517 @deffn Command handle-switch-frame frame | |
518 This function handles a focus event by selecting frame @var{frame}. | |
519 | |
520 Focus events normally do their job by invoking this command. | |
521 Don't call it for any other reason. | |
522 @end deffn | |
523 | |
524 @defun redirect-frame-focus frame focus-frame | |
525 This function redirects focus from @var{frame} to @var{focus-frame}. | |
526 This means that @var{focus-frame} will receive subsequent keystrokes and | |
527 intended for @var{frame}. After such an event, the value of | |
528 @code{last-event-frame} will be @var{focus-frame}. Also, switch-frame | |
529 events specifying @var{frame} will instead select @var{focus-frame}. | |
530 | |
531 If @var{focus-frame} is @code{nil}, that cancels any existing | |
532 redirection for @var{frame}, which therefore once again receives its own | |
533 events. | |
534 | |
535 One use of focus redirection is for frames that don't have minibuffers. | |
536 These frames use minibuffers on other frames. Activating a minibuffer | |
537 on another frame redirects focus to that frame. This puts the focus on | |
538 the minibuffer's frame, where it belongs, even though the mouse remains | |
539 in the frame which activated the minibuffer. | |
540 | |
541 Selecting a frame can also change focus redirections. Selecting frame | |
542 @code{bar}, when @code{foo} had been selected, changes any redirections | |
543 pointing to @code{foo} so that they point to @code{bar} instead. This | |
544 allows focus redirection to work properly when the user switches from | |
545 one frame to another using @code{select-window}. | |
546 | |
547 This means that a frame whose focus is redirected to itself is treated | |
548 differently from a frame whose focus is not redirected. | |
549 @code{select-frame} affects the former but not the latter. | |
550 | |
551 The redirection lasts until @code{redirect-frame-focus} is called to | |
552 change it. | |
553 @end defun | |
554 | |
555 @node Visibility of Frames | |
556 @section Visibility of Frames | |
557 @cindex visible frame | |
558 @cindex invisible frame | |
559 @cindex iconified frame | |
560 @cindex frame visibility | |
561 | |
562 A frame may be @dfn{visible}, @dfn{invisible}, or @dfn{iconified}. If | |
563 it is visible, you can see its contents. If it is iconified, the | |
564 frame's contents do not appear on the screen, but an icon does. If the | |
565 frame is invisible, it doesn't show in the screen, not even as an icon. | |
566 | |
567 @deffn Command make-frame-visible &optional frame | |
568 This function makes frame @var{frame} visible. If you omit @var{frame}, | |
569 it makes the selected frame visible. | |
570 @end deffn | |
571 | |
572 @deffn Command make-frame-invisible &optional frame | |
573 This function makes frame @var{frame} invisible. If you omit | |
574 @var{frame}, it makes the selected frame invisible. | |
575 @end deffn | |
576 | |
577 @deffn Command iconify-frame &optional frame | |
578 This function iconifies frame @var{frame}. If you omit @var{frame}, it | |
579 iconifies the selected frame. | |
580 @end deffn | |
581 | |
582 @defun frame-visible-p frame | |
583 This returns the visibility status of frame @var{frame}. The value is | |
584 @code{t} if @var{frame} is visible, @code{nil} if it is invisible, and | |
585 @code{icon} if it is iconified. | |
586 @end defun | |
587 | |
588 The visibility status of a frame is also available as a frame | |
589 parameter. You can read or change it as such. @xref{X Frame | |
590 Parameters}. | |
591 | |
592 @node Raising and Lowering | |
593 @section Raising and Lowering Frames | |
594 | |
595 The X Window System uses a desktop metaphor. Part of this metaphor is | |
596 the idea that windows are stacked in a notional third dimension | |
597 perpendicular to the screen surface, and thus ordered from ``highest'' | |
598 to ``lowest''. Where two windows overlap, the one higher up covers the | |
599 one underneath. Even a window at the bottom of the stack can be seen if | |
600 no other window overlaps it. | |
601 | |
602 @cindex raising a frame | |
603 @cindex lowering a frame | |
604 A window's place in this ordering is not fixed; in fact, users tend to | |
605 change the order frequently. @dfn{Raising} a window means moving it | |
606 ``up'', to the top of the stack. @dfn{Lowering} a window means moving | |
607 it to the bottom of the stack. This motion is in the notional third | |
608 dimension only, and does not change the position of the window on the | |
609 screen. | |
610 | |
611 You can raise and lower Emacs's X windows with these functions: | |
612 | |
613 @defun raise-frame frame | |
614 This function raises frame @var{frame}. | |
615 @end defun | |
616 | |
617 @defun lower-frame frame | |
618 This function lowers frame @var{frame}. | |
619 @end defun | |
620 | |
621 @defopt minibuffer-auto-raise | |
622 If this is non-@code{nil}, activation of the minibuffer raises the frame | |
623 that the minibuffer window is in. | |
624 @end defopt | |
625 | |
626 You can also enable auto-raise (raising automatically when a frame is | |
627 selected) or auto-lower (lowering automatically when it is deselected) | |
628 for any frame using frame parameters. @xref{X Frame Parameters}. | |
629 | |
630 @node Frame Configurations | |
631 @section Frame Configurations | |
632 @cindex frame configuration | |
633 | |
634 A @dfn{frame configuration} records the current arrangement of frames, | |
635 all their properties, and the window configuration of each one. | |
636 | |
637 @defun current-frame-configuration | |
638 This function returns a frame configuration list which describes | |
639 the current arrangement of frames and their contents. | |
640 @end defun | |
641 | |
642 @defun set-frame-configuration configuration | |
643 This function restores the state of frames described in | |
644 @var{configuration}. | |
645 @end defun | |
646 | |
647 @node Mouse Tracking | |
648 @section Mouse Tracking | |
649 @cindex mouse tracking | |
650 @cindex tracking the mouse | |
651 | |
652 Sometimes it is useful to @dfn{track} the mouse, which means, to display | |
653 something to indicate where the mouse is and move the indicator as the | |
654 mouse moves. For efficient mouse tracking, you need a way to wait until | |
655 the mouse actually moves. | |
656 | |
657 The convenient way to track the mouse is to ask for events to represent | |
658 mouse motion. Then you can wait for motion by waiting for an event. In | |
659 addition, you can easily handle any other sorts of events that may | |
660 occur. That is useful, because normally you don't want to track the | |
661 mouse forever---only until some other event, such as the release of a | |
662 button. | |
663 | |
664 @defspec track-mouse body@dots{} | |
665 Execute @var{body}, meanwhile generating input events for mouse motion. | |
666 The code in @var{body} can read these events with @code{read-event} or | |
667 @code{read-key-sequence}. @xref{Motion Events}, for the format of mouse | |
668 motion events. | |
669 | |
670 The value of @code{track-mouse} is that of the last form in @var{body}. | |
671 @end defspec | |
672 | |
673 The usual purpose of tracking mouse motion is to indicate on the screen | |
674 the consequences of pushing or releasing a button at the current | |
675 position. | |
676 | |
677 @ignore | |
678 @c These are not implemented yet. | |
679 | |
680 These functions change the screen appearance instantaneously. The | |
681 effect is transient, only until the next ordinary Emacs redisplay. That | |
682 is ok for mouse tracking, since it doesn't make sense for mouse tracking | |
683 to change the text, and the body of @code{track-mouse} normally reads | |
684 the events itself and does not do redisplay. | |
685 | |
686 @defun x-contour-region window beg end | |
687 This function draws lines to make a box around the text from @var{beg} | |
688 to @var{end}, in window @var{window}. | |
689 @end defun | |
690 | |
691 @defun x-uncontour-region window beg end | |
692 This function erases the lines that would make a box around the text | |
693 from @var{beg} to @var{end}, in window @var{window}. Use it to remove | |
694 a contour that you previously made by calling @code{x-contour-region}. | |
695 @end defun | |
696 | |
697 @defun x-draw-rectangle frame left top right bottom | |
698 This function draws a hollow rectangle on frame @var{frame} with the | |
699 specified edge coordinates, all measured in pixels from the inside top | |
700 left corner. It uses the cursor color, the one used for indicating the | |
701 location of point. | |
702 @end defun | |
703 | |
704 @defun x-erase-rectangle frame left top right bottom | |
705 This function erases a hollow rectangle on frame @var{frame} with the | |
706 specified edge coordinates, all measured in pixels from the inside top | |
707 left corner. Erasure means redrawing the text and background that | |
708 normally belong in the specified rectangle. | |
709 @end defun | |
710 @end ignore | |
711 | |
712 @node Mouse Position | |
713 @section Mouse Position | |
714 @cindex mouse position | |
715 @cindex position of mouse | |
716 | |
717 The functions @code{mouse-position} and @code{set-mouse-position} | |
718 give access to the current position of the mouse. | |
719 | |
720 @defun mouse-position | |
721 This function returns a description of the position of the mouse. The | |
722 value looks like @code{(@var{frame} @var{x} . @var{y})}, where @var{x} | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
723 and @var{y} are integers giving the position in characters relative to |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
724 the top left corner of the inside of @var{frame}. |
6547 | 725 @end defun |
726 | |
727 @defun set-mouse-position frame x y | |
728 This function @dfn{warps the mouse} to position @var{x}, @var{y} in | |
729 frame @var{frame}. The arguments @var{x} and @var{y} are integers, | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
730 giving the position in characters relative to the top left corner of the |
6547 | 731 inside of @var{frame}. |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
732 @end defun |
6547 | 733 |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
734 @defun mouse-pixel-position |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
735 This function is like @code{mouse-position} except that it returns |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
736 coordinates in units of pixels rather than units of characters. |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
737 @end defun |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
738 |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
739 @defun set-mouse-pixel-position frame x y |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
740 This function warps the mouse like @code{set-mouse-position} except that |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
741 @var{x} and @var{y} are in units of pixels rather than units of |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
742 characters. These coordinates are not required to be within the frame. |
6547 | 743 @end defun |
744 | |
745 @need 3000 | |
746 | |
747 @node Pop-Up Menus | |
748 @section Pop-Up Menus | |
749 | |
750 @defun x-popup-menu position menu | |
751 This function displays a pop-up menu and returns an indication of | |
752 what selection the user makes. | |
753 | |
754 The argument @var{position} specifies where on the screen to put the | |
755 menu. It can be either a mouse button event (which says to put the menu | |
756 where the user actuated the button) or a list of this form: | |
757 | |
758 @example | |
759 ((@var{xoffset} @var{yoffset}) @var{window}) | |
760 @end example | |
761 | |
762 @noindent | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
763 where @var{xoffset} and @var{yoffset} are coordinates, measured in |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
764 pixels, counting from the top left corner of @var{window}'s frame. |
6547 | 765 |
766 If @var{position} is @code{t}, it means to use the current mouse | |
767 position. If @var{position} is @code{nil}, it means to precompute the | |
768 key binding equivalents for the keymaps specified in @var{menu}, | |
769 without actually displaying or popping up the menu. | |
770 | |
771 The argument @var{menu} says what to display in the menu. It can be a | |
772 keymap or a list of keymaps (@pxref{Menu Keymaps}). Alternatively, it | |
773 can have the following form: | |
774 | |
775 @example | |
776 (@var{title} @var{pane1} @var{pane2}...) | |
777 @end example | |
778 | |
779 @noindent | |
780 where each pane is a list of form | |
781 | |
782 @example | |
783 (@var{title} (@var{line} @var{item})...) | |
784 @end example | |
785 | |
786 Each @var{line} should be a string, and each @var{item} should be the | |
787 value to return if that @var{line} is chosen. | |
788 @end defun | |
789 | |
790 @strong{Usage note:} Don't use @code{x-popup-menu} to display a menu if | |
791 a prefix key with a menu keymap would do the job. If you use a menu | |
792 keymap to implement a menu, @kbd{C-h c} and @kbd{C-h a} can see the | |
793 individual items in that menu and provide help for them. If instead you | |
794 implement the menu by defining a command that calls @code{x-popup-menu}, | |
795 the help facilities cannot know what happens inside that command, so | |
796 they cannot give any help for the menu's items. This is the reason why | |
797 all the menu bar items except @samp{Buffers} are implemented with menu | |
798 keymaps (@pxref{Menu Keymaps}). | |
799 | |
800 @node Dialog Boxes | |
801 @section Dialog Boxes | |
802 @cindex dialog boxes | |
803 | |
804 A dialog box is a variant of a pop-up menu. It looks a little | |
805 different (if Emacs uses an X toolkit), it always appears in the center | |
806 of a frame, and it has just one level and one pane. The main use of | |
807 dialog boxes is for asking questions that the user can answer with | |
808 ``yes'', ``no'', and a few other alternatives. The functions | |
809 @code{y-or-n-p} and @code{yes-or-no-p} use dialog boxes instead of the | |
810 keyboard, when called from commands invoked by mouse clicks. | |
811 | |
812 @defun x-popup-dialog position contents | |
813 This function displays a pop-up dialog box and returns an indication of | |
814 what selection the user makes. The argument @var{contents} specifies | |
815 the alternatives to offer; it has this format: | |
816 | |
817 @example | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
818 (@var{title} (@var{string} . @var{value})@dots{}) |
6547 | 819 @end example |
820 | |
821 @noindent | |
822 which looks like the list that specifies a single pane for | |
823 @code{x-popup-menu}. | |
824 | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
825 The return value is @var{value} from the chosen alternative. |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
826 |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
827 An element of the list may be just a string instead of a cons cell |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
828 @code{(@var{string} . @var{value})}. That makes a box that cannot |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
829 be selected. |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
830 |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
831 If @code{nil} appears in the list, it separates the left-hand items from |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
832 the right-hand items; items that precede the @code{nil} appear on the |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
833 left, and items that follow the @code{nil} appear on the right. If you |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
834 don't include a @code{nil} in the list, then approximately half the |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
835 items appear on each side. |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
836 |
6547 | 837 Dialog boxes always appear in the center of a frame; the argument |
838 @var{position} specifies which frame. The possible values are as in | |
839 @code{x-popup-menu}, but the precise coordinates don't matter; only the | |
840 frame matters. | |
7174
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
841 |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
842 If your Emacs executable does not use an X toolkit, then it cannot |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
843 display a real dialog box; so instead it displays the same items in a |
0313f520a4d9
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
6547
diff
changeset
|
844 pop-up menu in the center of the frame. |
6547 | 845 @end defun |
846 | |
7684
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
847 @node Pointer Shapes |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
848 @section Pointer Shapes |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
849 @cindex pointer shape |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
850 @cindex mouse pointer shape |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
851 |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
852 These variables specify which mouse pointer shape to use in various |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
853 situations: |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
854 |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
855 @table @code |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
856 @item x-pointer-shape |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
857 @vindex x-pointer-shape |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
858 This variable specifies the pointer shape to use ordinarily in the Emacs |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
859 frame. |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
860 |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
861 @item x-sensitive-text-pointer-shape |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
862 @vindex x-sensitive-text-pointer-shape |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
863 This variable specifies the pointer shape to use when the mouse |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
864 is over mouse-sensitive text. |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
865 @end table |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
866 |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
867 These variables affect newly created frames. They do not normally |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
868 affect existing frames; however, if you set the mouse color of a frame, |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
869 that also updates its pointer shapes based on the current values of |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
870 these variables. @xref{X Frame Parameters}. |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
871 |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
872 The values you can use, to specify either of these pointer shapes, are |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
873 defined in the file @file{lisp/x-win.el}. Use @kbd{M-x apropos |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
874 @key{RET} x-pointer @key{RET}} to see a list of them. |
ec7caebc4a1d
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
7174
diff
changeset
|
875 |
6547 | 876 @node X Selections |
877 @section X Selections | |
878 @cindex selection (for X windows) | |
879 | |
880 The X server records a set of @dfn{selections} which permit transfer of | |
881 data between application programs. The various selections are | |
882 distinguished by @dfn{selection types}, represented in Emacs by | |
883 symbols. X clients including Emacs can read or set the selection for | |
884 any given type. | |
885 | |
886 @defun x-set-selection type data | |
887 This function sets a ``selection'' in the X server. It takes two | |
888 arguments: a selection type @var{type}, and the value to assign to it, | |
889 @var{data}. If @var{data} is @code{nil}, it means to clear out the | |
890 selection. Otherwise, @var{data} may be a string, a symbol, an integer | |
891 (or a cons of two integers or list of two integers), an overlay, or a | |
892 cons of two markers pointing to the same buffer. An overlay or a pair | |
893 of markers stands for text in the overlay or between the markers. | |
894 | |
895 The data may also be a vector of valid non-vector selection values. | |
896 | |
897 Each possible @var{type} has its own selection value, which changes | |
898 independently. The usual values of @var{type} are @code{PRIMARY} and | |
899 @code{SECONDARY}; these are symbols with upper-case names, in accord | |
900 with X Window System conventions. The default is @code{PRIMARY}. | |
901 @end defun | |
902 | |
903 @defun x-get-selection type data-type | |
904 This function accesses selections set up by Emacs or by other X | |
905 clients. It takes two optional arguments, @var{type} and | |
906 @var{data-type}. The default for @var{type}, the selection type, is | |
907 @code{PRIMARY}. | |
908 | |
909 The @var{data-type} argument specifies the form of data conversion to | |
910 use, to convert the raw data obtained from another X client into Lisp | |
911 data. Meaningful values include @code{TEXT}, @code{STRING}, | |
912 @code{TARGETS}, @code{LENGTH}, @code{DELETE}, @code{FILE_NAME}, | |
913 @code{CHARACTER_POSITION}, @code{LINE_NUMBER}, @code{COLUMN_NUMBER}, | |
914 @code{OWNER_OS}, @code{HOST_NAME}, @code{USER}, @code{CLASS}, | |
915 @code{NAME}, @code{ATOM}, and @code{INTEGER}. (These are symbols with | |
916 upper-case names in accord with X conventions.) The default for | |
917 @var{data-type} is @code{STRING}. | |
918 @end defun | |
919 | |
920 @cindex cut buffer | |
921 The X server also has a set of numbered @dfn{cut buffers} which can | |
922 store text or other data being moved between applications. Cut buffers | |
923 are considered obsolete, but Emacs supports them for the sake of X | |
924 clients that still use them. | |
925 | |
926 @defun x-get-cut-buffer n | |
927 This function returns the contents of cut buffer number @var{n}. | |
928 @end defun | |
929 | |
930 @defun x-set-cut-buffer string | |
931 This function stores @var{string} into the first cut buffer (cut buffer | |
932 0), moving the other values down through the series of cut buffers, much | |
933 like the way successive kills in Emacs move down the kill ring. | |
934 @end defun | |
935 | |
936 @node X Connections | |
937 @section X Connections | |
938 | |
939 You can close the connection with the X server with the function | |
940 @code{x-close-current-connection}, and open a new one with | |
941 @code{x-open-connection} (perhaps with a different server and display). | |
942 | |
943 @defun x-close-current-connection | |
944 This function closes the connection to the X server. It deletes all | |
945 frames, making Emacs effectively inaccessible to the user; therefore, a | |
946 Lisp program that closes the connection should open another one. | |
947 @end defun | |
948 | |
949 @defun x-open-connection display &optional resource-string | |
950 This function opens a connection to an X server, for use of display | |
951 @var{display}. | |
952 | |
953 The optional argument @var{resource-string} is a string of resource | |
954 names and values, in the same format used in the @file{.Xresources} | |
955 file. The values you specify override the resource values recorded in | |
956 the X server itself. Here's an example of what this string might look | |
957 like: | |
958 | |
959 @example | |
960 "*BorderWidth: 3\n*InternalBorder: 2\n" | |
961 @end example | |
962 | |
963 @xref{Resources}. | |
964 @end defun | |
965 | |
966 @defun x-display-color-p | |
967 This returns @code{t} if the connected X display has color, and | |
968 @code{nil} otherwise. | |
969 @end defun | |
970 | |
971 @defun x-color-defined-p color | |
972 This function reports whether a color name is meaningful and supported | |
973 on the X display Emacs is using. It returns @code{t} if the display | |
974 supports that color; otherwise, @code{nil}. | |
975 | |
976 Black-and-white displays support just two colors, @code{"black"} or | |
977 @code{"white"}. Color displays support many other colors. | |
978 @end defun | |
979 | |
980 @defun x-synchronize flag | |
981 The function @code{x-synchronize} enables or disables synchronous | |
982 communication with the X server. It enables synchronous communication | |
983 if @var{flag} is non-@code{nil}, and disables it if @var{flag} is | |
984 @code{nil}. | |
985 | |
986 In synchronous mode, Emacs waits for a response to each X protocol | |
987 command before doing anything else. This is useful for debugging Emacs, | |
988 because protocol errors are reported right away, which helps you find | |
989 the erroneous command. Synchronous mode is not the default because it | |
990 is much slower. | |
991 @end defun | |
992 | |
993 @node Resources | |
994 @section X Resources | |
995 | |
996 @defun x-get-resource attribute &optional name class | |
997 The function @code{x-get-resource} retrieves a resource value from the X | |
998 Windows defaults database. | |
999 | |
1000 Resources are indexed by a combination of a @dfn{key} and a @dfn{class}. | |
1001 This function searches using a key of the form | |
1002 @samp{@var{instance}.@var{attribute}}, using the name under which Emacs | |
1003 was invoked as @var{instance}, and using @samp{Emacs} as the class. | |
1004 | |
1005 The optional arguments @var{component} and @var{subclass} add to the key | |
1006 and the class, respectively. You must specify both of them or neither. | |
1007 If you specify them, the key is | |
1008 @samp{@var{instance}.@var{component}.@var{attribute}}, and the class is | |
1009 @samp{Emacs.@var{subclass}}. | |
1010 @end defun | |
1011 | |
1012 @xref{Resources X, X Resources,, emacs, The GNU Emacs Manual}. | |
1013 | |
1014 @node Server Data | |
1015 @section Data about the X Server | |
1016 | |
1017 This section describes functions and a variable that you can use to | |
1018 get information about the capabilities and origin of the X server that | |
1019 Emacs is displaying its frames on. | |
1020 | |
1021 @defun x-display-screens | |
1022 This function returns the number of screens associated with the current | |
1023 display. | |
1024 @end defun | |
1025 | |
1026 @defun x-server-version | |
1027 This function returns the list of version numbers of the X server in | |
1028 use. | |
1029 @end defun | |
1030 | |
1031 @defun x-server-vendor | |
1032 This function returns the vendor supporting the X server in use. | |
1033 @end defun | |
1034 | |
1035 @defun x-display-pixel-height | |
1036 This function returns the height of this X screen in pixels. | |
1037 @end defun | |
1038 | |
1039 @defun x-display-mm-height | |
1040 This function returns the height of this X screen in millimeters. | |
1041 @end defun | |
1042 | |
1043 @defun x-display-pixel-width | |
1044 This function returns the width of this X screen in pixels. | |
1045 @end defun | |
1046 | |
1047 @defun x-display-mm-width | |
1048 This function returns the width of this X screen in millimeters. | |
1049 @end defun | |
1050 | |
1051 @defun x-display-backing-store | |
1052 This function returns the backing store capability of this screen. | |
1053 Values can be the symbols @code{always}, @code{when-mapped}, or | |
1054 @code{not-useful}. | |
1055 @end defun | |
1056 | |
1057 @defun x-display-save-under | |
1058 This function returns non-@code{nil} if this X screen supports the | |
1059 SaveUnder feature. | |
1060 @end defun | |
1061 | |
1062 @defun x-display-planes | |
1063 This function returns the number of planes this display supports. | |
1064 @end defun | |
1065 | |
1066 @defun x-display-visual-class | |
1067 This function returns the visual class for this X screen. The value is | |
1068 one of the symbols @code{static-gray}, @code{gray-scale}, | |
1069 @code{static-color}, @code{pseudo-color}, @code{true-color}, and | |
1070 @code{direct-color}. | |
1071 @end defun | |
1072 | |
1073 @defun x-display-color-p | |
1074 This function returns @code{t} if the X screen in use is a color | |
1075 screen. | |
1076 @end defun | |
1077 | |
1078 @defun x-display-color-cells | |
1079 This function returns the number of color cells this X screen supports. | |
1080 @end defun | |
1081 | |
1082 @ignore | |
1083 @defvar x-no-window-manager | |
1084 This variable's value is is @code{t} if no X window manager is in use. | |
1085 @end defvar | |
1086 @end ignore | |
1087 | |
1088 @ignore | |
1089 @item | |
1090 The functions @code{x-pixel-width} and @code{x-pixel-height} return the | |
1091 width and height of an X Window frame, measured in pixels. | |
1092 @end ignore |