comparison lispref/frames.texi @ 56535:fee4457701d8

Various changes in addition to: (Creating Frames): Expand and clarify description of `make-frame'. (Window Frame Parameters): Either none or both of the `icon-left' and `icon-top' parameters must be specified. Put descriptions of `menu-bar-lines' and `toolbar-lines' closer together and change them accordingly. (Frame Titles): `multiple-frames' is not guaranteed to be accurate except while processing `frame-title-format' or `icon-title-format'. (Deleting Frames): Correct description of `delete-frame'. Non-nil return values of `frame-live-p' are like those of `framep'. (Frames and Windows): mention return value of `set-frame-selected-window'. (Visibility of Frames): Mention `force' argument to `make-frame-invisible'. `frame-visible-p' returns t for all frames on text-only terminals. (Frame Configurations): Restoring a frame configuration does not restore deleted frames. (Window System Selections): `x-set-selection' returns DATA. (Resources): Add example. (Display Feature Testing): Clarify descriptions of `display-pixel-height', `display-pixel-width', `x-server-version' and `x-server-vendor'.
author Luc Teirlinck <teirllm@auburn.edu>
date Sat, 24 Jul 2004 23:47:39 +0000
parents dcdd02599cbd
children 3df9006c09e2 c08afac24467
comparison
equal deleted inserted replaced
56534:3d8fa211fc46 56535:fee4457701d8
77 @section Creating Frames 77 @section Creating Frames
78 78
79 To create a new frame, call the function @code{make-frame}. 79 To create a new frame, call the function @code{make-frame}.
80 80
81 @defun make-frame &optional alist 81 @defun make-frame &optional alist
82 This function creates a new frame. If you are using a supported window 82 This function creates and returns a new frame, displaying the current
83 system, it makes a window frame; otherwise, it makes a terminal frame. 83 buffer. If you are using a supported window system, it makes a window
84 frame; otherwise, it makes a terminal frame.
84 85
85 The argument is an alist specifying frame parameters. Any parameters 86 The argument is an alist specifying frame parameters. Any parameters
86 not mentioned in @var{alist} default according to the value of the 87 not mentioned in @var{alist} default according to the value of the
87 variable @code{default-frame-alist}; parameters not specified even there 88 variable @code{default-frame-alist}; parameters not specified even there
88 default from the standard X resources or whatever is used instead on 89 default from the standard X resources or whatever is used instead on
89 your system. 90 your system.
90 91
91 The set of possible parameters depends in principle on what kind of 92 The set of possible parameters depends in principle on what kind of
92 window system Emacs uses to display its frames. @xref{Window Frame 93 window system Emacs uses to display its frames. @xref{Window Frame
93 Parameters}, for documentation of individual parameters you can specify. 94 Parameters}, for documentation of individual parameters you can specify.
95
96 This function itself does not make the new frame the selected frame.
97 @xref{Input Focus}. The previously selected frame remains selected.
98 However, the window system may select the new frame for its own reasons,
99 for instance if the frame appears under the mouse pointer and your
100 setup is for focus to follow the pointer.
94 @end defun 101 @end defun
95 102
96 @defvar before-make-frame-hook 103 @defvar before-make-frame-hook
97 A normal hook run by @code{make-frame} before it actually creates the 104 A normal hook run by @code{make-frame} before it actually creates the
98 frame. 105 frame.
136 screens belonging to one server, Emacs knows by the similarity in their 143 screens belonging to one server, Emacs knows by the similarity in their
137 names that they share a single keyboard, and it treats them as a single 144 names that they share a single keyboard, and it treats them as a single
138 terminal. 145 terminal.
139 146
140 @deffn Command make-frame-on-display display &optional parameters 147 @deffn Command make-frame-on-display display &optional parameters
141 This creates a new frame on display @var{display}, taking the other 148 This creates and returns a new frame on display @var{display}, taking
142 frame parameters from @var{parameters}. Aside from the @var{display} 149 the other frame parameters from @var{parameters}. Aside from the
143 argument, it is like @code{make-frame} (@pxref{Creating Frames}). 150 @var{display} argument, it is like @code{make-frame} (@pxref{Creating
151 Frames}).
144 @end deffn 152 @end deffn
145 153
146 @defun x-display-list 154 @defun x-display-list
147 This returns a list that indicates which X displays Emacs has a 155 This returns a list that indicates which X displays Emacs has a
148 connection to. The elements of the list are strings, and each one is 156 connection to. The elements of the list are strings, and each one is
163 171
164 @example 172 @example
165 "*BorderWidth: 3\n*InternalBorder: 2\n" 173 "*BorderWidth: 3\n*InternalBorder: 2\n"
166 @end example 174 @end example
167 175
168 @xref{Resources}. 176 @xref{X Resources,, X Resources, emacs, The GNU Emacs Manual}.
169 177
170 If @var{must-succeed} is non-@code{nil}, failure to open the connection 178 If @var{must-succeed} is non-@code{nil}, failure to open the connection
171 terminates Emacs. Otherwise, it is an ordinary Lisp error. 179 terminates Emacs. Otherwise, it is an ordinary Lisp error.
172 @end defun 180 @end defun
173 181
205 These functions let you read and change the parameter values of a 213 These functions let you read and change the parameter values of a
206 frame. 214 frame.
207 215
208 @defun frame-parameter frame parameter 216 @defun frame-parameter frame parameter
209 @tindex frame-parameter 217 @tindex frame-parameter
210 This function returns the value of the parameter named @var{parameter} 218 This function returns the value of the parameter @var{parameter} (a
211 of @var{frame}. If @var{frame} is @code{nil}, it returns the 219 symbol) of @var{frame}. If @var{frame} is @code{nil}, it returns the
212 selected frame's parameter. 220 selected frame's parameter. If @var{frame} has no setting for
221 @var{parameter}, this function returns @code{nil}.
213 @end defun 222 @end defun
214 223
215 @defun frame-parameters &optional frame 224 @defun frame-parameters &optional frame
216 The function @code{frame-parameters} returns an alist listing all the 225 The function @code{frame-parameters} returns an alist listing all the
217 parameters of @var{frame} and their values. If @var{frame} is 226 parameters of @var{frame} and their values. If @var{frame} is
228 @end defun 237 @end defun
229 238
230 @defun modify-all-frames-parameters alist 239 @defun modify-all-frames-parameters alist
231 This function alters the frame parameters of all existing frames 240 This function alters the frame parameters of all existing frames
232 according to @var{alist}, then modifies @code{default-frame-alist} 241 according to @var{alist}, then modifies @code{default-frame-alist}
233 to apply the same parameter values to frames that will be created 242 (and, if necessary, @code{initial-frame-alist}) to apply the same
234 henceforth. 243 parameter values to frames that will be created henceforth.
235 @end defun 244 @end defun
236 245
237 @node Initial Parameters 246 @node Initial Parameters
238 @subsection Initial Frame Parameters 247 @subsection Initial Frame Parameters
239 248
283 @defvar default-frame-alist 292 @defvar default-frame-alist
284 This is an alist specifying default values of frame parameters for all 293 This is an alist specifying default values of frame parameters for all
285 Emacs frames---the first frame, and subsequent frames. When using the X 294 Emacs frames---the first frame, and subsequent frames. When using the X
286 Window System, you can get the same results by means of X resources 295 Window System, you can get the same results by means of X resources
287 in many cases. 296 in many cases.
297
298 Setting this variable does not affect existing frames.
288 @end defvar 299 @end defvar
289 300
290 See also @code{special-display-frame-alist}, in @ref{Choosing Window}. 301 See also @code{special-display-frame-alist}. @xref{Definition of
302 special-display-frame-alist}.
291 303
292 If you use options that specify window appearance when you invoke Emacs, 304 If you use options that specify window appearance when you invoke Emacs,
293 they take effect by adding elements to @code{default-frame-alist}. One 305 they take effect by adding elements to @code{default-frame-alist}. One
294 exception is @samp{-geometry}, which adds the specified position to 306 exception is @samp{-geometry}, which adds the specified position to
295 @code{initial-frame-alist} instead. @xref{Command Arguments,,, emacs, 307 @code{initial-frame-alist} instead. @xref{Command Arguments,,, emacs,
365 377
366 @item icon-left 378 @item icon-left
367 The screen position of the left edge @emph{of the frame's icon}, in 379 The screen position of the left edge @emph{of the frame's icon}, in
368 pixels, counting from the left edge of the screen. This takes effect if 380 pixels, counting from the left edge of the screen. This takes effect if
369 and when the frame is iconified. 381 and when the frame is iconified.
382
383 If you specify a value for this parameter, then you must also specify
384 a value for @code{icon-top} and vice versa. The window manager may
385 ignore these two parameters.
370 386
371 @item icon-top 387 @item icon-top
372 The screen position of the top edge @emph{of the frame's icon}, in 388 The screen position of the top edge @emph{of the frame's icon}, in
373 pixels, counting from the top edge of the screen. This takes effect if 389 pixels, counting from the top edge of the screen. This takes effect if
374 and when the frame is iconified. 390 and when the frame is iconified.
526 542
527 The combined fringe widths must add up to an integral number of 543 The combined fringe widths must add up to an integral number of
528 columns, so the actual default fringe widths for the frame may be 544 columns, so the actual default fringe widths for the frame may be
529 larger than the specified values. The extra width needed to reach an 545 larger than the specified values. The extra width needed to reach an
530 acceptable total is distributed evenly between the left and right 546 acceptable total is distributed evenly between the left and right
531 fringe. However, you can force one frame or the other to a precise 547 fringe. However, you can force one fringe or the other to a precise
532 width by specifying that width a negative integer. If both widths are 548 width by specifying that width as a negative integer. If both widths are
533 negative, only the left fringe gets the specified width. 549 negative, only the left fringe gets the specified width.
534 550
535 @item unsplittable 551 @item unsplittable
536 If non-@code{nil}, this frame's window is never split automatically. 552 If non-@code{nil}, this frame's window is never split automatically.
537 553
539 The state of visibility of the frame. There are three possibilities: 555 The state of visibility of the frame. There are three possibilities:
540 @code{nil} for invisible, @code{t} for visible, and @code{icon} for 556 @code{nil} for invisible, @code{t} for visible, and @code{icon} for
541 iconified. @xref{Visibility of Frames}. 557 iconified. @xref{Visibility of Frames}.
542 558
543 @item menu-bar-lines 559 @item menu-bar-lines
544 The number of lines to allocate at the top of the frame for a menu bar. 560 The number of lines to allocate at the top of the frame for a menu
545 The default is 1. @xref{Menu Bar}. (In Emacs versions that use the X 561 bar. The default is 1. A value of @code{nil} means don't display a
546 toolkit or GTK, there is only one menu bar line; all that matters about the 562 menu bar. @xref{Menu Bar}. (The X toolkit and GTK allow at most one
547 number you specify is whether it is greater than zero.) 563 menu bar line; they treat larger values as 1.)
564
565 @item tool-bar-lines
566 The number of lines to use for the toolbar. A value of @code{nil} means
567 don't display a tool bar. (GTK allows at most one tool bar line; it
568 treats larger values as 1.)
548 569
549 @item screen-gamma 570 @item screen-gamma
550 @cindex gamma correction 571 @cindex gamma correction
551 If this is a number, Emacs performs ``gamma correction'' which adjusts 572 If this is a number, Emacs performs ``gamma correction'' which adjusts
552 the brightness of all colors. The value should be the screen gamma of 573 the brightness of all colors. The value should be the screen gamma of
555 Usual PC monitors have a screen gamma of 2.2, so color values in 576 Usual PC monitors have a screen gamma of 2.2, so color values in
556 Emacs, and in X windows generally, are calibrated to display properly 577 Emacs, and in X windows generally, are calibrated to display properly
557 on a monitor with that gamma value. If you specify 2.2 for 578 on a monitor with that gamma value. If you specify 2.2 for
558 @code{screen-gamma}, that means no correction is needed. Other values 579 @code{screen-gamma}, that means no correction is needed. Other values
559 request correction, designed to make the corrected colors appear on 580 request correction, designed to make the corrected colors appear on
560 your screen they way they would have appeared without correction on an 581 your screen the way they would have appeared without correction on an
561 ordinary monitor with a gamma value of 2.2. 582 ordinary monitor with a gamma value of 2.2.
562 583
563 If your monitor displays colors too light, you should specify a 584 If your monitor displays colors too light, you should specify a
564 @code{screen-gamma} value smaller than 2.2. This requests correction 585 @code{screen-gamma} value smaller than 2.2. This requests correction
565 that makes colors darker. A screen gamma value of 1.5 may give good 586 that makes colors darker. A screen gamma value of 1.5 may give good
566 results for LCD color displays. 587 results for LCD color displays.
567 588
568 @item tool-bar-lines
569 The number of lines to use for the toolbar. A value of @code{nil} means
570 don't display a tool bar. (In Emacs versions that use GTK, there is
571 only one tool bar line; all that matters about the number you specify
572 is whether it is greater than zero.)
573
574 @item line-spacing 589 @item line-spacing
575 Additional space put below text lines in pixels (a positive integer). 590 Additional space put below text lines, in pixels (a positive integer)
591
592 @item wait-for-wm
593 If non-@code{nil}, tell Xt to wait for the window manager to confirm
594 geometry changes. Some window managers, including versions of Fvwm2
595 and KDE, fail to confirm, so Xt hangs. Set this to @code{nil} to
596 prevent hanging with those window managers.
576 597
577 @ignore 598 @ignore
578 @item parent-id 599 @item parent-id
579 @c ??? Not yet working. 600 @c ??? Not yet working.
580 The X window number of the window that should be the parent of this one. 601 The X window number of the window that should be the parent of this one.
635 656
636 @item scroll-bar-background 657 @item scroll-bar-background
637 If non-@code{nil}, the color for the background of scroll bars. It is 658 If non-@code{nil}, the color for the background of scroll bars. It is
638 equivalent to the @code{:background} attribute of the 659 equivalent to the @code{:background} attribute of the
639 @code{scroll-bar} face. 660 @code{scroll-bar} face.
640
641 @item wait-for-wm
642 If non-@code{nil}, tell Xt to wait for the window manager to confirm
643 geometry changes. Some window managers, including versions of Fvwm2
644 and KDE, fail to confirm, so Xt hangs. Set this to @code{nil} to
645 prevent hanging with those window managers.
646 @end table 661 @end table
647 662
648 @node Size and Position 663 @node Size and Position
649 @subsection Frame Size And Position 664 @subsection Frame Size And Position
650 @cindex size of frame 665 @cindex size of frame
816 This variable is set automatically by Emacs. Its value is @code{t} when 831 This variable is set automatically by Emacs. Its value is @code{t} when
817 there are two or more frames (not counting minibuffer-only frames or 832 there are two or more frames (not counting minibuffer-only frames or
818 invisible frames). The default value of @code{frame-title-format} uses 833 invisible frames). The default value of @code{frame-title-format} uses
819 @code{multiple-frames} so as to put the buffer name in the frame title 834 @code{multiple-frames} so as to put the buffer name in the frame title
820 only when there is more than one frame. 835 only when there is more than one frame.
836
837 The value of this variable is not guaranteed to be accurate except
838 while processing @code{frame-title-format} or
839 @code{icon-title-format}.
821 @end defvar 840 @end defvar
822 841
823 @node Deleting Frames 842 @node Deleting Frames
824 @section Deleting Frames 843 @section Deleting Frames
825 @cindex deletion of frames 844 @cindex deletion of frames
826 845
827 Frames remain potentially visible until you explicitly @dfn{delete} 846 Frames remain potentially visible until you explicitly @dfn{delete}
828 them. A deleted frame cannot appear on the screen, but continues to 847 them. A deleted frame cannot appear on the screen, but continues to
829 exist as a Lisp object until there are no references to it. There is no 848 exist as a Lisp object until there are no references to it.
830 way to cancel the deletion of a frame aside from restoring a saved frame
831 configuration (@pxref{Frame Configurations}); this is similar to the
832 way windows behave.
833 849
834 @deffn Command delete-frame &optional frame force 850 @deffn Command delete-frame &optional frame force
835 @vindex delete-frame-functions 851 @vindex delete-frame-functions
836 This function deletes the frame @var{frame} after running the hook 852 This function deletes the frame @var{frame}. Unless @var{frame} is a
837 @code{delete-frame-functions} (each function gets one argument, 853 tooltip, it first runs the hook @code{delete-frame-functions} (each
838 @var{frame}). By default, @var{frame} is the selected frame. 854 function gets one argument, @var{frame}). By default, @var{frame} is
855 the selected frame.
839 856
840 A frame cannot be deleted if its minibuffer is used by other frames. 857 A frame cannot be deleted if its minibuffer is used by other frames.
841 Normally, you cannot delete a frame if all other frames are invisible, 858 Normally, you cannot delete a frame if all other frames are invisible,
842 but if the @var{force} is non-@code{nil}, then you are allowed to do so. 859 but if the @var{force} is non-@code{nil}, then you are allowed to do so.
843 @end deffn 860 @end deffn
844 861
845 @defun frame-live-p frame 862 @defun frame-live-p frame
846 The function @code{frame-live-p} returns non-@code{nil} if the frame 863 The function @code{frame-live-p} returns non-@code{nil} if the frame
847 @var{frame} has not been deleted. 864 @var{frame} has not been deleted. The possible non-@code{nil} return
865 values are like those of @code{framep}. @xref{Frames}.
848 @end defun 866 @end defun
849 867
850 Some window managers provide a command to delete a window. These work 868 Some window managers provide a command to delete a window. These work
851 by sending a special message to the program that operates the window. 869 by sending a special message to the program that operates the window.
852 When Emacs gets one of these commands, it generates a 870 When Emacs gets one of these commands, it generates a
927 frame}. The significance of this designation is that selecting the 945 frame}. The significance of this designation is that selecting the
928 frame also selects this window. You can get the frame's current 946 frame also selects this window. You can get the frame's current
929 selected window with @code{frame-selected-window}. 947 selected window with @code{frame-selected-window}.
930 948
931 @defun frame-selected-window &optional frame 949 @defun frame-selected-window &optional frame
932 This function returns the window on @var{frame} that is selected within 950 This function returns the window on @var{frame} that is selected
933 @var{frame}. If omitted or @code{nil}, @var{frame} defaults to the selected frame. 951 within @var{frame}. If omitted or @code{nil}, @var{frame} defaults to
952 the selected frame.
934 @end defun 953 @end defun
935 954
936 @defun set-frame-selected-window frame window 955 @defun set-frame-selected-window frame window
937 This sets the selected window of frame @var{frame} to @var{window}. 956 This sets the selected window of frame @var{frame} to @var{window}.
938 If @var{frame} is @code{nil}, it operates on the selected frame. If 957 If @var{frame} is @code{nil}, it operates on the selected frame. If
939 @var{frame} is the selected frame, this makes @var{window} the 958 @var{frame} is the selected frame, this makes @var{window} the
940 selected window. 959 selected window. This function returns @var{window}.
941 @end defun 960 @end defun
942 961
943 Conversely, selecting a window for Emacs with @code{select-window} also 962 Conversely, selecting a window for Emacs with @code{select-window} also
944 makes that window selected within its frame. @xref{Selecting Windows}. 963 makes that window selected within its frame. @xref{Selecting Windows}.
945 964
946 Another function that (usually) returns one of the windows in a given 965 Another function that (usually) returns one of the windows in a given
947 frame is @code{minibuffer-window}. @xref{Minibuffer Misc}. 966 frame is @code{minibuffer-window}. @xref{Definition of minibuffer-window}.
948 967
949 @node Minibuffers and Frames 968 @node Minibuffers and Frames
950 @section Minibuffers and Frames 969 @section Minibuffers and Frames
951 970
952 Normally, each frame has its own minibuffer window at the bottom, which 971 Normally, each frame has its own minibuffer window at the bottom, which
953 is used whenever that frame is selected. If the frame has a minibuffer, 972 is used whenever that frame is selected. If the frame has a minibuffer,
954 you can get it with @code{minibuffer-window} (@pxref{Minibuffer Misc}). 973 you can get it with @code{minibuffer-window} (@pxref{Definition of
974 minibuffer-window}).
955 975
956 However, you can also create a frame with no minibuffer. Such a frame 976 However, you can also create a frame with no minibuffer. Such a frame
957 must use the minibuffer window of some other frame. When you create the 977 must use the minibuffer window of some other frame. When you create the
958 frame, you can specify explicitly the minibuffer window to use (in some 978 frame, you can specify explicitly the minibuffer window to use (in some
959 other frame). If you don't, then the minibuffer is found in the frame 979 other frame). If you don't, then the minibuffer is found in the frame
964 when you enter the minibuffer. If so, set the variable 984 when you enter the minibuffer. If so, set the variable
965 @code{minibuffer-auto-raise} to @code{t}. @xref{Raising and Lowering}. 985 @code{minibuffer-auto-raise} to @code{t}. @xref{Raising and Lowering}.
966 986
967 @defvar default-minibuffer-frame 987 @defvar default-minibuffer-frame
968 This variable specifies the frame to use for the minibuffer window, by 988 This variable specifies the frame to use for the minibuffer window, by
969 default. It is always local to the current terminal and cannot be 989 default. It does not affect existing frames. It is always local to
970 buffer-local. @xref{Multiple Displays}. 990 the current terminal and cannot be buffer-local. @xref{Multiple
991 Displays}.
971 @end defvar 992 @end defvar
972 993
973 @node Input Focus 994 @node Input Focus
974 @section Input Focus 995 @section Input Focus
975 @cindex input focus 996 @cindex input focus
1024 @c ??? This is not yet implemented properly. 1045 @c ??? This is not yet implemented properly.
1025 @defun select-frame frame 1046 @defun select-frame frame
1026 This function selects frame @var{frame}, temporarily disregarding the 1047 This function selects frame @var{frame}, temporarily disregarding the
1027 focus of the X server if any. The selection of @var{frame} lasts until 1048 focus of the X server if any. The selection of @var{frame} lasts until
1028 the next time the user does something to select a different frame, or 1049 the next time the user does something to select a different frame, or
1029 until the next time this function is called. The specified @var{frame} 1050 until the next time this function is called. (If you are using a
1051 window system, the previously selected frame may be restored as the
1052 selected frame after return to the command loop, because it still may
1053 have the window system's input focus.) The specified @var{frame}
1030 becomes the selected frame, as explained above, and the terminal that 1054 becomes the selected frame, as explained above, and the terminal that
1031 @var{frame} is on becomes the selected terminal. This function 1055 @var{frame} is on becomes the selected terminal. This function
1032 returns @var{frame}, or @code{nil} if @var{frame} has been deleted. 1056 returns @var{frame}, or @code{nil} if @var{frame} has been deleted.
1033 1057
1034 In general, you should never use @code{select-frame} in a way that could 1058 In general, you should never use @code{select-frame} in a way that could
1105 @deffn Command make-frame-visible &optional frame 1129 @deffn Command make-frame-visible &optional frame
1106 This function makes frame @var{frame} visible. If you omit @var{frame}, 1130 This function makes frame @var{frame} visible. If you omit @var{frame},
1107 it makes the selected frame visible. 1131 it makes the selected frame visible.
1108 @end deffn 1132 @end deffn
1109 1133
1110 @deffn Command make-frame-invisible &optional frame 1134 @deffn Command make-frame-invisible &optional frame force
1111 This function makes frame @var{frame} invisible. If you omit 1135 This function makes frame @var{frame} invisible. If you omit
1112 @var{frame}, it makes the selected frame invisible. 1136 @var{frame}, it makes the selected frame invisible.
1137
1138 Unless @var{force} is non-@code{nil}, this function refuses to make
1139 @var{frame} invisible if all other frames are invisible..
1113 @end deffn 1140 @end deffn
1114 1141
1115 @deffn Command iconify-frame &optional frame 1142 @deffn Command iconify-frame &optional frame
1116 This function iconifies frame @var{frame}. If you omit @var{frame}, it 1143 This function iconifies frame @var{frame}. If you omit @var{frame}, it
1117 iconifies the selected frame. 1144 iconifies the selected frame.
1119 1146
1120 @defun frame-visible-p frame 1147 @defun frame-visible-p frame
1121 This returns the visibility status of frame @var{frame}. The value is 1148 This returns the visibility status of frame @var{frame}. The value is
1122 @code{t} if @var{frame} is visible, @code{nil} if it is invisible, and 1149 @code{t} if @var{frame} is visible, @code{nil} if it is invisible, and
1123 @code{icon} if it is iconified. 1150 @code{icon} if it is iconified.
1151
1152 On a text-only terminal, all frames are considered visible, whether
1153 they are currently being displayed or not, and this function returns
1154 @code{t} for all frames.
1124 @end defun 1155 @end defun
1125 1156
1126 The visibility status of a frame is also available as a frame 1157 The visibility status of a frame is also available as a frame
1127 parameter. You can read or change it as such. @xref{Window Frame 1158 parameter. You can read or change it as such. @xref{Window Frame
1128 Parameters}. 1159 Parameters}.
1153 1184
1154 You can raise and lower Emacs frame Windows with these functions: 1185 You can raise and lower Emacs frame Windows with these functions:
1155 1186
1156 @deffn Command raise-frame &optional frame 1187 @deffn Command raise-frame &optional frame
1157 This function raises frame @var{frame} (default, the selected frame). 1188 This function raises frame @var{frame} (default, the selected frame).
1189 If @var{frame} is invisible or iconified, this makes it visible.
1158 @end deffn 1190 @end deffn
1159 1191
1160 @deffn Command lower-frame &optional frame 1192 @deffn Command lower-frame &optional frame
1161 This function lowers frame @var{frame} (default, the selected frame). 1193 This function lowers frame @var{frame} (default, the selected frame).
1162 @end deffn 1194 @end deffn
1183 the current arrangement of frames and their contents. 1215 the current arrangement of frames and their contents.
1184 @end defun 1216 @end defun
1185 1217
1186 @defun set-frame-configuration configuration &optional nodelete 1218 @defun set-frame-configuration configuration &optional nodelete
1187 This function restores the state of frames described in 1219 This function restores the state of frames described in
1188 @var{configuration}. 1220 @var{configuration}. However, this function does not restore deleted
1221 frames.
1189 1222
1190 Ordinarily, this function deletes all existing frames not listed in 1223 Ordinarily, this function deletes all existing frames not listed in
1191 @var{configuration}. But if @var{nodelete} is non-@code{nil}, the 1224 @var{configuration}. But if @var{nodelete} is non-@code{nil}, the
1192 unwanted frames are iconified instead. 1225 unwanted frames are iconified instead.
1193 @end defun 1226 @end defun
1465 data between application programs. The various selections are 1498 data between application programs. The various selections are
1466 distinguished by @dfn{selection types}, represented in Emacs by 1499 distinguished by @dfn{selection types}, represented in Emacs by
1467 symbols. X clients including Emacs can read or set the selection for 1500 symbols. X clients including Emacs can read or set the selection for
1468 any given type. 1501 any given type.
1469 1502
1470 @defun x-set-selection type data 1503 @deffn Command x-set-selection type data
1471 This function sets a ``selection'' in the X server. It takes two 1504 This function sets a ``selection'' in the X server. It takes two
1472 arguments: a selection type @var{type}, and the value to assign to it, 1505 arguments: a selection type @var{type}, and the value to assign to it,
1473 @var{data}. If @var{data} is @code{nil}, it means to clear out the 1506 @var{data}. If @var{data} is @code{nil}, it means to clear out the
1474 selection. Otherwise, @var{data} may be a string, a symbol, an integer 1507 selection. Otherwise, @var{data} may be a string, a symbol, an integer
1475 (or a cons of two integers or list of two integers), an overlay, or a 1508 (or a cons of two integers or list of two integers), an overlay, or a
1480 selection values. 1513 selection values.
1481 1514
1482 Each possible @var{type} has its own selection value, which changes 1515 Each possible @var{type} has its own selection value, which changes
1483 independently. The usual values of @var{type} are @code{PRIMARY}, 1516 independently. The usual values of @var{type} are @code{PRIMARY},
1484 @code{SECONDARY} and @code{CLIPBOARD}; these are symbols with upper-case 1517 @code{SECONDARY} and @code{CLIPBOARD}; these are symbols with upper-case
1485 names, in accord with X Window System conventions. The default is 1518 names, in accord with X Window System conventions. If @var{type} is
1486 @code{PRIMARY}. 1519 @code{nil}, that stands for @code{PRIMARY}.
1487 @end defun 1520
1521 This function returns @var{data}.
1522 @end deffn
1488 1523
1489 @defun x-get-selection &optional type data-type 1524 @defun x-get-selection &optional type data-type
1490 This function accesses selections set up by Emacs or by other X 1525 This function accesses selections set up by Emacs or by other X
1491 clients. It takes two optional arguments, @var{type} and 1526 clients. It takes two optional arguments, @var{type} and
1492 @var{data-type}. The default for @var{type}, the selection type, is 1527 @var{data-type}. The default for @var{type}, the selection type, is
1576 1611
1577 @defun defined-colors &optional frame 1612 @defun defined-colors &optional frame
1578 @tindex defined-colors 1613 @tindex defined-colors
1579 This function returns a list of the color names that are defined 1614 This function returns a list of the color names that are defined
1580 and supported on frame @var{frame} (default, the selected frame). 1615 and supported on frame @var{frame} (default, the selected frame).
1616 If @var{frame} does not support colors, the value is @code{nil}.
1581 1617
1582 @findex x-defined-colors 1618 @findex x-defined-colors
1583 This function used to be called @code{x-defined-colors}, 1619 This function used to be called @code{x-defined-colors},
1584 and that name is still supported as an alias. 1620 and that name is still supported as an alias.
1585 @end defun 1621 @end defun
1600 1636
1601 @defun color-gray-p color &optional frame 1637 @defun color-gray-p color &optional frame
1602 @tindex color-gray-p 1638 @tindex color-gray-p
1603 This returns @code{t} if @var{color} is a shade of gray, as defined on 1639 This returns @code{t} if @var{color} is a shade of gray, as defined on
1604 @var{frame}'s display. If @var{frame} is omitted or @code{nil}, the 1640 @var{frame}'s display. If @var{frame} is omitted or @code{nil}, the
1605 question applies to the selected frame. The argument @var{color} must 1641 question applies to the selected frame. If @var{color} is not a valid
1606 be a valid color name. 1642 color name, this function returns @code{nil}.
1607 @end defun 1643 @end defun
1608 1644
1609 @defun color-values color &optional frame 1645 @defun color-values color &optional frame
1610 @tindex color-values 1646 @tindex color-values
1611 This function returns a value that describes what @var{color} should 1647 This function returns a value that describes what @var{color} should
1612 ideally look like. If @var{color} is defined, the value is a list of 1648 ideally look like on @var{frame}. If @var{color} is defined, the
1613 three integers, which give the amount of red, the amount of green, and 1649 value is a list of three integers, which give the amount of red, the
1614 the amount of blue. Each integer ranges in principle from 0 to 65535, 1650 amount of green, and the amount of blue. Each integer ranges in
1615 but in practice no value seems to be above 65280. This kind 1651 principle from 0 to 65535, but some displays may not use the full
1616 of three-element list is called an @dfn{rgb value}. 1652 range. This kind of three-element list is called an @dfn{rgb value}.
1617 1653
1618 If @var{color} is not defined, the value is @code{nil}. 1654 If @var{color} is not defined, the value is @code{nil}.
1619 1655
1620 @example 1656 @example
1621 (color-values "black") 1657 (color-values "black")
1656 1692
1657 @cindex rgb value 1693 @cindex rgb value
1658 Several of these functions use or return @dfn{rgb values}. An rgb 1694 Several of these functions use or return @dfn{rgb values}. An rgb
1659 value is a list of three integers, which give the amount of red, the 1695 value is a list of three integers, which give the amount of red, the
1660 amount of green, and the amount of blue. Each integer ranges in 1696 amount of green, and the amount of blue. Each integer ranges in
1661 principle from 0 to 65535, but in practice the largest value used is 1697 principle from 0 to 65535, but some displays may not use the full range. .
1662 65280.
1663 1698
1664 These functions accept a display (either a frame or the name of a 1699 These functions accept a display (either a frame or the name of a
1665 terminal) as an optional argument. We hope in the future to make Emacs 1700 terminal) as an optional argument. We hope in the future to make Emacs
1666 support more than one text-only terminal at one time; then this argument 1701 support more than one text-only terminal at one time; then this argument
1667 will specify which terminal to operate on (the default being the 1702 will specify which terminal to operate on (the default being the
1699 1734
1700 @defun tty-color-approximate rgb &optional display 1735 @defun tty-color-approximate rgb &optional display
1701 @tindex tty-color-approximate 1736 @tindex tty-color-approximate
1702 This function finds the closest color, among the known colors supported 1737 This function finds the closest color, among the known colors supported
1703 for @var{display}, to that described by the rgb value @var{rgb}. 1738 for @var{display}, to that described by the rgb value @var{rgb}.
1739 The return value is an element of @code{tty-color-alist}.
1704 @end defun 1740 @end defun
1705 1741
1706 @defun tty-color-translate color &optional display 1742 @defun tty-color-translate color &optional display
1707 @tindex tty-color-translate 1743 @tindex tty-color-translate
1708 This function finds the closest color to @var{color} among the known 1744 This function finds the closest color to @var{color} among the known
1709 colors supported for @var{display}. If the name @var{color} is not 1745 colors supported for @var{display} and returns its index (an integer).
1710 defined, the value is @code{nil}. 1746 If the name @var{color} is not defined, the value is @code{nil}.
1711 1747
1712 @var{color} can be an X-style @code{"#@var{xxxyyyzzz}"} specification 1748 @var{color} can be an X-style @code{"#@var{xxxyyyzzz}"} specification
1713 instead of an actual name. The format 1749 instead of an actual name. The format
1714 @code{"RGB:@var{xx}/@var{yy}/@var{zz}"} is also supported. 1750 @code{"RGB:@var{xx}/@var{yy}/@var{zz}"} is also supported.
1715 @end defun 1751 @end defun
1744 @defvar x-resource-name 1780 @defvar x-resource-name
1745 This variable specifies the instance name that @code{x-get-resource} 1781 This variable specifies the instance name that @code{x-get-resource}
1746 should look up. The default value is the name Emacs was invoked with, 1782 should look up. The default value is the name Emacs was invoked with,
1747 or the value specified with the @samp{-name} or @samp{-rn} switches. 1783 or the value specified with the @samp{-name} or @samp{-rn} switches.
1748 @end defvar 1784 @end defvar
1785
1786 To illustrate some of the above, suppose that you have the line:
1787
1788 @example
1789 xterm.vt100.background: yellow
1790 @end example
1791
1792 @noindent
1793 in in your X resources file (usually named @file{~/.Xdefaults} or
1794 @file{~/.Xresources}). Then:
1795
1796 @example
1797 @group
1798 (let ((x-resource-class "XTerm") (x-resource-name "xterm"))
1799 (x-get-resource "vt100.background" "VT100.Background"))
1800 @result{} "yellow"
1801 @end group
1802 @group
1803 (let ((x-resource-class "XTerm") (x-resource-name "xterm"))
1804 (x-get-resource "background" "VT100" "vt100" "Background"))
1805 @result{} "yellow"
1806 @end group
1807 @end example
1749 1808
1750 @xref{X Resources,, X Resources, emacs, The GNU Emacs Manual}. 1809 @xref{X Resources,, X Resources, emacs, The GNU Emacs Manual}.
1751 1810
1752 @node Display Feature Testing 1811 @node Display Feature Testing
1753 @section Display Feature Testing 1812 @section Display Feature Testing
1852 @end defun 1911 @end defun
1853 1912
1854 @defun display-pixel-height &optional display 1913 @defun display-pixel-height &optional display
1855 @tindex display-pixel-height 1914 @tindex display-pixel-height
1856 This function returns the height of the screen in pixels. 1915 This function returns the height of the screen in pixels.
1916 On a character terminal, it gives the height in characters.
1857 @end defun 1917 @end defun
1858 1918
1859 @defun display-mm-height &optional display 1919 @defun display-mm-height &optional display
1860 @tindex display-mm-height 1920 @tindex display-mm-height
1861 This function returns the height of the screen in millimeters, 1921 This function returns the height of the screen in millimeters,
1863 @end defun 1923 @end defun
1864 1924
1865 @defun display-pixel-width &optional display 1925 @defun display-pixel-width &optional display
1866 @tindex display-pixel-width 1926 @tindex display-pixel-width
1867 This function returns the width of the screen in pixels. 1927 This function returns the width of the screen in pixels.
1928 On a character terminal, it gives the width in characters.
1868 @end defun 1929 @end defun
1869 1930
1870 @defun display-mm-width &optional display 1931 @defun display-mm-width &optional display
1871 @tindex display-mm-width 1932 @tindex display-mm-width
1872 This function returns the width of the screen in millimeters, 1933 This function returns the width of the screen in millimeters,
1916 These functions obtain additional information specifically 1977 These functions obtain additional information specifically
1917 about X displays. 1978 about X displays.
1918 1979
1919 @defun x-server-version &optional display 1980 @defun x-server-version &optional display
1920 This function returns the list of version numbers of the X server 1981 This function returns the list of version numbers of the X server
1921 running the display. 1982 running the display. The value is a list of three integers: the major
1983 and minor version numbers, and the vendor-specific release number.
1922 @end defun 1984 @end defun
1923 1985
1924 @defun x-server-vendor &optional display 1986 @defun x-server-vendor &optional display
1925 This function returns the vendor that provided the X server software. 1987 This function returns the ``vendor'' that provided the X server software
1988 (as a string).
1926 @end defun 1989 @end defun
1927 1990
1928 @ignore 1991 @ignore
1929 @defvar x-no-window-manager 1992 @defvar x-no-window-manager
1930 This variable's value is @code{t} if no X window manager is in use. 1993 This variable's value is @code{t} if no X window manager is in use.