elisp: Creating Frames
28.1 Creating Frames
====================
To create a new frame, call the function ‘make-frame’.
-- Command: make-frame &optional alist
This function creates and returns a new frame, displaying the
current buffer.
The ALIST argument is an alist that specifies frame parameters for
the new frame. Frame Parameters. If you specify the
‘terminal’ parameter in ALIST, the new frame is created on that
terminal. Otherwise, if you specify the ‘window-system’ frame
parameter in ALIST, that determines whether the frame should be
displayed on a text terminal or a graphical terminal. Window
Systems. If neither is specified, the new frame is created in
the same terminal as the selected frame.
Any parameters not mentioned in ALIST default to the values in the
alist ‘default-frame-alist’ (Initial Parameters);
parameters not specified there default from the X resources or its
equivalent on your operating system (X Resources (emacs)X
Resources.). After the frame is created, Emacs applies any
parameters listed in ‘frame-inherited-parameters’ (see below) and
not present in the argument, taking the values from the frame that
was selected when ‘make-frame’ was called.
Note that on multi-monitor displays (Multiple Terminals),
the window manager might position the frame differently than
specified by the positional parameters in ALIST (Position
Parameters). For example, some window managers have a policy of
displaying the frame on the monitor that contains the largest part
of the window (a.k.a. the “dominating” monitor).
This function itself does not make the new frame the selected
frame. Input Focus. The previously selected frame remains
selected. On graphical terminals, however, the windowing system
may select the new frame for its own reasons.
-- Variable: before-make-frame-hook
A normal hook run by ‘make-frame’ before it creates the frame.
-- Variable: after-make-frame-functions
An abnormal hook run by ‘make-frame’ after it creates the frame.
Each function in ‘after-make-frame-functions’ receives one
argument, the frame just created.
-- Variable: frame-inherited-parameters
This variable specifies the list of frame parameters that a newly
created frame inherits from the currently selected frame. For each
parameter (a symbol) that is an element in the list and is not
present in the argument to ‘make-frame’, the function sets the
value of that parameter in the created frame to its value in the
selected frame.