Function: modify-frame-parameters
modify-frame-parameters is a function defined in frame.c.
Signature
(modify-frame-parameters FRAME ALIST)
Documentation
Modify FRAME according to new values of its parameters in ALIST.
If FRAME is nil, it defaults to the selected frame.
ALIST is an alist of parameters to change and their new values.
Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.
Which PARMs are meaningful depends on the kind of frame.
The meaningful parameters are acted upon, i.e. the frame is changed
according to their new values, and are also stored in the frame's
parameter list so that frame-parameters will return them.
PARMs that are not meaningful are still stored in the frame's parameter
list, but are otherwise ignored.
Probably introduced at or before Emacs version 19.29.
Source Code
// Defined in /usr/src/emacs/src/frame.c
{
struct frame *f = decode_live_frame (frame);
Lisp_Object prop, val;
/* I think this should be done with a hook. */
#ifdef HAVE_WINDOW_SYSTEM
if (FRAME_WINDOW_P (f))
gui_set_frame_parameters (f, alist);
else
#endif
#ifdef MSDOS
if (FRAME_MSDOS_P (f))
IT_set_frame_parameters (f, alist);
else
#endif
{
EMACS_INT length = list_length (alist);
ptrdiff_t i;
Lisp_Object *parms;
Lisp_Object *values;
USE_SAFE_ALLOCA;
SAFE_ALLOCA_LISP (parms, 2 * length);
values = parms + length;
/* Extract parm names and values into those vectors. */
for (i = 0; CONSP (alist); alist = XCDR (alist))
{
Lisp_Object elt;
elt = XCAR (alist);
parms[i] = Fcar (elt);
values[i] = Fcdr (elt);
i++;
}
/* Now process them in reverse of specified order. */
while (--i >= 0)
{
prop = parms[i];
val = values[i];
store_frame_param (f, prop, val);
if (EQ (prop, Qforeground_color)
|| EQ (prop, Qbackground_color))
update_face_from_frame_parameter (f, prop, val);
}
SAFE_FREE ();
}
return Qnil;
}