comparison lispref/frames.texi @ 22138:d4ac295a98b3

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Tue, 19 May 1998 03:45:57 +0000
parents 90da2489c498
children 40089afa2b1d
comparison
equal deleted inserted replaced
22137:2b0e6a1e7fb9 22138:d4ac295a98b3
11 Emacs windows. A frame initially contains a single main window (plus 11 Emacs windows. A frame initially contains a single main window (plus
12 perhaps a minibuffer window), which you can subdivide vertically or 12 perhaps a minibuffer window), which you can subdivide vertically or
13 horizontally into smaller windows. 13 horizontally into smaller windows.
14 14
15 @cindex terminal frame 15 @cindex terminal frame
16 @cindex X window frame
17 When Emacs runs on a text-only terminal, it starts with one 16 When Emacs runs on a text-only terminal, it starts with one
18 @dfn{terminal frame}. If you create additional ones, Emacs displays 17 @dfn{terminal frame}. If you create additional ones, Emacs displays
19 one and only one at any given time---on the terminal screen, of course. 18 one and only one at any given time---on the terminal screen, of course.
20 19
20 @cindex window frame
21 When Emacs communicates directly with a supported window system, such 21 When Emacs communicates directly with a supported window system, such
22 as X Windows, it does not have a terminal frame; instead, it starts with 22 as X Windows, it does not have a terminal frame; instead, it starts with
23 a single @dfn{window frame}, but you can create more, and Emacs can 23 a single @dfn{window frame}, but you can create more, and Emacs can
24 display several such frames at once as is usual for window systems. 24 display several such frames at once as is usual for window systems.
25 25
75 The set of possible parameters depends in principle on what kind of 75 The set of possible parameters depends in principle on what kind of
76 window system Emacs uses to display its frames. @xref{Window Frame 76 window system Emacs uses to display its frames. @xref{Window Frame
77 Parameters}, for documentation of individual parameters you can specify. 77 Parameters}, for documentation of individual parameters you can specify.
78 @end defun 78 @end defun
79 79
80 @defvar before-make-frame-hook
80 @tindex before-make-frame-hook 81 @tindex before-make-frame-hook
81 @defvar before-make-frame-hook
82 A normal hook run by @code{make-frame} before it actually creates the 82 A normal hook run by @code{make-frame} before it actually creates the
83 frame. 83 frame.
84 @end defvar 84 @end defvar
85 85
86 @defvar after-make-frame-hook
86 @tindex after-make-frame-hook 87 @tindex after-make-frame-hook
87 @defvar after-make-frame-hook
88 An abnormal hook run by @code{make-frame} after it creates the frame. 88 An abnormal hook run by @code{make-frame} after it creates the frame.
89 Each function in @code{after-make-frame-hook} receives one argument, the 89 Each function in @code{after-make-frame-hook} receives one argument, the
90 frame just created. 90 frame just created.
91 @end defvar 91 @end defvar
92 92
263 window frame; of these, @code{name}, @code{title}, @code{height}, 263 window frame; of these, @code{name}, @code{title}, @code{height},
264 @code{width}, @code{buffer-list} and @code{buffer-predicate} provide 264 @code{width}, @code{buffer-list} and @code{buffer-predicate} provide
265 meaningful information in terminal frames. 265 meaningful information in terminal frames.
266 266
267 @table @code 267 @table @code
268 @item display
269 The display on which to open this frame. It should be a string of the
270 form @code{"@var{host}:@var{dpy}.@var{screen}"}, just like the
271 @code{DISPLAY} environment variable.
272
268 @item title 273 @item title
269 If a frame has a non-@code{nil} title, it appears in the window system's 274 If a frame has a non-@code{nil} title, it appears in the window system's
270 border for the frame, and also in the mode line of windows in that frame 275 border for the frame, and also in the mode line of windows in that frame
271 if @code{mode-line-frame-identification} uses @samp{%F} 276 if @code{mode-line-frame-identification} uses @samp{%F}
272 (@pxref{%-Constructs}). This is normally the case when Emacs is not 277 (@pxref{%-Constructs}). This is normally the case when Emacs is not
281 286
282 If you specify the frame name explicitly when you create the frame, the 287 If you specify the frame name explicitly when you create the frame, the
283 name is also used (instead of the name of the Emacs executable) when 288 name is also used (instead of the name of the Emacs executable) when
284 looking up X resources for the frame. 289 looking up X resources for the frame.
285 290
286 @item display
287 The display on which to open this frame. It should be a string of the
288 form @code{"@var{host}:@var{dpy}.@var{screen}"}, just like the
289 @code{DISPLAY} environment variable.
290
291 @item left 291 @item left
292 The screen position of the left edge, in pixels, with respect to the 292 The screen position of the left edge, in pixels, with respect to the
293 left edge of the screen. The value may be a positive number @var{pos}, 293 left edge of the screen. The value may be a positive number @var{pos},
294 or a list of the form @code{(+ @var{pos})} which permits specifying a 294 or a list of the form @code{(+ @var{pos})} which permits specifying a
295 negative @var{pos} value. 295 negative @var{pos} value.
380 A list of buffers that have been selected in this frame, 380 A list of buffers that have been selected in this frame,
381 ordered most-recently-selected first. 381 ordered most-recently-selected first.
382 382
383 @item font 383 @item font
384 The name of the font for displaying text in the frame. This is a 384 The name of the font for displaying text in the frame. This is a
385 string. 385 string, either a valid font name for your system or the name of an Emacs
386 fontset (@pxref{Fontsets}).
386 387
387 @item auto-raise 388 @item auto-raise
388 Whether selecting the frame raises it (non-@code{nil} means yes). 389 Whether selecting the frame raises it (non-@code{nil} means yes).
389 390
390 @item auto-lower 391 @item auto-lower
455 The number of lines to allocate at the top of the frame for a menu bar. 456 The number of lines to allocate at the top of the frame for a menu bar.
456 The default is 1. @xref{Menu Bar}. (In Emacs versions that use the X 457 The default is 1. @xref{Menu Bar}. (In Emacs versions that use the X
457 toolkit, there is only one menu bar line; all that matters about the 458 toolkit, there is only one menu bar line; all that matters about the
458 number you specify is whether it is greater than zero.) 459 number you specify is whether it is greater than zero.)
459 460
461 @ignore
460 @item parent-id 462 @item parent-id
461 @c ??? Not yet working. 463 @c ??? Not yet working.
462 The X window number of the window that should be the parent of this one. 464 The X window number of the window that should be the parent of this one.
463 Specifying this lets you create an Emacs window inside some other 465 Specifying this lets you create an Emacs window inside some other
464 application's window. (It is not certain this will be implemented; try 466 application's window. (It is not certain this will be implemented; try
465 it and see if it works.) 467 it and see if it works.)
468 @end ignore
466 @end table 469 @end table
467 470
468 @node Size and Position 471 @node Size and Position
469 @subsection Frame Size And Position 472 @subsection Frame Size And Position
470 473
818 821
819 The redirection lasts until @code{redirect-frame-focus} is called to 822 The redirection lasts until @code{redirect-frame-focus} is called to
820 change it. 823 change it.
821 @end defun 824 @end defun
822 825
826 @defopt focus-follows-mouse
823 @tindex focus-follows-mouse 827 @tindex focus-follows-mouse
824 @defopt focus-follows-mouse
825 This option is how you inform Emacs whether the window manager transfers 828 This option is how you inform Emacs whether the window manager transfers
826 focus when the user moves the mouse. Non-@code{nil} says that it does. 829 focus when the user moves the mouse. Non-@code{nil} says that it does.
827 When this is so, the command @code{other-frame} moves the mouse to a 830 When this is so, the command @code{other-frame} moves the mouse to a
828 position consistent with the new selected frame. 831 position consistent with the new selected frame.
829 @end defopt 832 @end defopt
893 third dimension only, and does not change the position of the window 896 third dimension only, and does not change the position of the window
894 on the screen. 897 on the screen.
895 898
896 You can raise and lower Emacs frame Windows with these functions: 899 You can raise and lower Emacs frame Windows with these functions:
897 900
898 @deffn Command raise-frame frame 901 @deffn Command raise-frame &optional frame
899 This function raises frame @var{frame}. 902 This function raises frame @var{frame} (default, the selected frame).
900 @end deffn 903 @end deffn
901 904
902 @deffn Command lower-frame frame 905 @deffn Command lower-frame &optional frame
903 This function lowers frame @var{frame}. 906 This function lowers frame @var{frame} (default, the selected frame).
904 @end deffn 907 @end deffn
905 908
906 @defopt minibuffer-auto-raise 909 @defopt minibuffer-auto-raise
907 If this is non-@code{nil}, activation of the minibuffer raises the frame 910 If this is non-@code{nil}, activation of the minibuffer raises the frame
908 that the minibuffer window is in. 911 that the minibuffer window is in.
1020 1023
1021 @defun set-mouse-position frame x y 1024 @defun set-mouse-position frame x y
1022 This function @dfn{warps the mouse} to position @var{x}, @var{y} in 1025 This function @dfn{warps the mouse} to position @var{x}, @var{y} in
1023 frame @var{frame}. The arguments @var{x} and @var{y} are integers, 1026 frame @var{frame}. The arguments @var{x} and @var{y} are integers,
1024 giving the position in characters relative to the top left corner of the 1027 giving the position in characters relative to the top left corner of the
1025 inside of @var{frame}. 1028 inside of @var{frame}. If @var{frame} is not visible, this function
1029 does nothing. The return value is not significant.
1026 @end defun 1030 @end defun
1027 1031
1028 @defun mouse-pixel-position 1032 @defun mouse-pixel-position
1029 This function is like @code{mouse-position} except that it returns 1033 This function is like @code{mouse-position} except that it returns
1030 coordinates in units of pixels rather than units of characters. 1034 coordinates in units of pixels rather than units of characters.
1032 1036
1033 @defun set-mouse-pixel-position frame x y 1037 @defun set-mouse-pixel-position frame x y
1034 This function warps the mouse like @code{set-mouse-position} except that 1038 This function warps the mouse like @code{set-mouse-position} except that
1035 @var{x} and @var{y} are in units of pixels rather than units of 1039 @var{x} and @var{y} are in units of pixels rather than units of
1036 characters. These coordinates are not required to be within the frame. 1040 characters. These coordinates are not required to be within the frame.
1041
1042 If @var{frame} is not visible, this function does nothing. The return
1043 value is not significant.
1037 @end defun 1044 @end defun
1038 1045
1039 @need 3000 1046 @need 3000
1040 1047
1041 @node Pop-Up Menus 1048 @node Pop-Up Menus
1263 return. If this is non-@code{nil}, then the return value is truncated 1270 return. If this is non-@code{nil}, then the return value is truncated
1264 after the first @var{maximum} matching fonts. Specifying a small value 1271 after the first @var{maximum} matching fonts. Specifying a small value
1265 for @var{maximum} can make this function much faster, in cases where 1272 for @var{maximum} can make this function much faster, in cases where
1266 many fonts match the pattern. 1273 many fonts match the pattern.
1267 @end defun 1274 @end defun
1275
1276 @node Fontsets
1277 @section Fontsets
1278
1279 A @dfn{fontset} is a list of fonts, each assigned to a range of
1280 character codes. An individual font cannot display the whole range of
1281 characters that Emacs supports, but a fontset can. Fontsets have names,
1282 just as fonts do, and you can use a fontset name in place of a font name
1283 when you specify the ``font'' for a frame or a face. Here is
1284 information about defining a fontset under Lisp program control.
1285
1286 @defun create-fontset-from-fontset-spec fontset-spec &optional style noerror
1287 This function defines a new fontset according to the specification
1288 string @var{fontset-spec}. The string should have this format:
1289
1290 @smallexample
1291 @var{fontpattern}, @r{[}@var{charsetname}:@var{fontname}@r{]@dots{}}
1292 @end smallexample
1293
1294 @noindent
1295 Whitespace characters before and after the commas are ignored.
1296
1297 The first part of the string, @var{fontpattern}, should have the form of
1298 a standard X font name, except that the last two fields should be
1299 @samp{fontset-@var{alias}}.
1300
1301 Each fontset has two names, one long and one short. The long name is
1302 @var{fontpattern} in its entirety. The short name is
1303 @samp{fontset-@var{alias}}. You can refer to the fontset by either
1304 name. If a fontset with the same name already exists, an error is
1305 signaled, unless @var{noerror} is non-@code{nil}, in which case this
1306 function does nothing.
1307
1308 The specification string also says which fonts to use in the fontset.
1309 See below for the details.
1310 @end defun
1311
1312 If optional argument @var{style} is specified, it specifies a way to
1313 modify the fontset. It should be one of @code{bold}, @code{italic}, and
1314 @code{bold-italic}, and it says to find the bold, italic or bold-italic
1315 version of each font if possible.
1316
1317 The construct @samp{@var{charset}:@var{font}} specifies which font to
1318 use (in this fontset) for one particular character set. Here,
1319 @var{charset} is the name of a character set, and @var{font} is the font
1320 to use for that character set. You can use this construct any number of
1321 times in the specification string.
1322
1323 For the remaining character sets, those that you don't specify
1324 explicitly, Emacs chooses a font based on @var{fontpattern}: it replaces
1325 @samp{fontset-@var{alias}} with a value that names one character set.
1326 For the @sc{ASCII} character set, @samp{fontset-@var{alias}} is replaced
1327 with @samp{ISO8859-1}.
1328
1329 In addition, when several consecutive fields are wildcards, Emacs
1330 collapses them into a single wildcard. This is to prevent use of
1331 auto-scaled fonts. Fonts made by scaling larger fonts are not usable
1332 for editing, and scaling a smaller font is not useful because it is
1333 better to use the smaller font in its own size, which Emacs does.
1334
1335 Thus if @var{fontpattern} is this,
1336
1337 @example
1338 -*-fixed-medium-r-normal-*-24-*-*-*-*-*-fontset-24
1339 @end example
1340
1341 @noindent
1342 the font specification for ASCII characters would be this:
1343
1344 @example
1345 -*-fixed-medium-r-normal-*-24-*-ISO8859-1
1346 @end example
1347
1348 @noindent
1349 and the font specification for Chinese GB2312 characters would be this:
1350
1351 @example
1352 -*-fixed-medium-r-normal-*-24-*-gb2312*-*
1353 @end example
1354
1355 You may not have any Chinese font matching the above font
1356 specification. Most X distributions include only Chinese fonts that
1357 have @samp{song ti} or @samp{fangsong ti} in @var{family} field. In
1358 such a case, @samp{Fontset-@var{n}} can be specified as below:
1359
1360 @smallexample
1361 Emacs.Fontset-0: -*-fixed-medium-r-normal-*-24-*-*-*-*-*-fontset-24,\
1362 chinese-gb2312:-*-*-medium-r-normal-*-24-*-gb2312*-*
1363 @end smallexample
1364
1365 @noindent
1366 Then, the font specifications for all but Chinese GB2312 characters have
1367 @samp{fixed} in the @var{family} field, and the font specification for
1368 Chinese GB2312 characters has a wild card @samp{*} in the @var{family}
1369 field.
1268 1370
1269 @node Color Names 1371 @node Color Names
1270 @section Color Names 1372 @section Color Names
1271 1373
1272 @defun x-color-defined-p color &optional frame 1374 @defun x-color-defined-p color &optional frame
1420 This function returns the number of color cells the screen supports. 1522 This function returns the number of color cells the screen supports.
1421 @end defun 1523 @end defun
1422 1524
1423 @ignore 1525 @ignore
1424 @defvar x-no-window-manager 1526 @defvar x-no-window-manager
1425 This variable's value is is @code{t} if no X window manager is in use. 1527 This variable's value is @code{t} if no X window manager is in use.
1426 @end defvar 1528 @end defvar
1427 @end ignore 1529 @end ignore
1428 1530
1429 @ignore 1531 @ignore
1430 @item 1532 @item