annotate lispref/frames.texi @ 11873:6ac51c0face8

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