comparison src/frame.c @ 31399:db831ffcd565

(Qdisplay_type): New variable. (syms_of_frame_1): Initialize it. (Fframe_parameter): New function that avoids consing. (syms_of_frame): Defsubr it.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 05 Sep 2000 15:53:29 +0000
parents 6a0caa788013
children cb166d3ac8e7
comparison
equal deleted inserted replaced
31398:fbaf3c51578e 31399:db831ffcd565
102 Lisp_Object Qmac; 102 Lisp_Object Qmac;
103 Lisp_Object Qvisible; 103 Lisp_Object Qvisible;
104 Lisp_Object Qbuffer_predicate; 104 Lisp_Object Qbuffer_predicate;
105 Lisp_Object Qbuffer_list; 105 Lisp_Object Qbuffer_list;
106 Lisp_Object Qtitle; 106 Lisp_Object Qtitle;
107 Lisp_Object Qdisplay_type;
107 108
108 Lisp_Object Vterminal_frame; 109 Lisp_Object Vterminal_frame;
109 Lisp_Object Vdefault_frame_alist; 110 Lisp_Object Vdefault_frame_alist;
110 Lisp_Object Vmouse_position_function; 111 Lisp_Object Vmouse_position_function;
111 112
151 staticpro (&Qbuffer_predicate); 152 staticpro (&Qbuffer_predicate);
152 Qbuffer_list = intern ("buffer-list"); 153 Qbuffer_list = intern ("buffer-list");
153 staticpro (&Qbuffer_list); 154 staticpro (&Qbuffer_list);
154 Qtitle = intern ("title"); 155 Qtitle = intern ("title");
155 staticpro (&Qtitle); 156 staticpro (&Qtitle);
157 Qdisplay_type = intern ("display-type");
158 staticpro (&Qdisplay_type);
156 159
157 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist, 160 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
158 "Alist of default values for frame creation.\n\ 161 "Alist of default values for frame creation.\n\
159 These may be set in your init file, like this:\n\ 162 These may be set in your init file, like this:\n\
160 (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1))\n\ 163 (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1))\n\
2078 2081
2079 UNGCPRO; 2082 UNGCPRO;
2080 return alist; 2083 return alist;
2081 } 2084 }
2082 2085
2086
2087 DEFUN ("frame-parameter", Fframe_parameter, Sframe_parameter, 2, 2, 0,
2088 "Return FRAME's value for parameter PARAMETER.\n\
2089 If FRAME is nil, describe the currently selected frame.")
2090 (frame, parameter)
2091 Lisp_Object frame, parameter;
2092 {
2093 struct frame *f;
2094 Lisp_Object value;
2095
2096 if (NILP (frame))
2097 frame = selected_frame;
2098 else
2099 CHECK_FRAME (frame, 0);
2100 CHECK_SYMBOL (parameter, 1);
2101
2102 f = XFRAME (frame);
2103 value = Qnil;
2104
2105 if (FRAME_LIVE_P (f))
2106 {
2107 value = Fassq (parameter, f->param_alist);
2108 if (CONSP (value))
2109 value = XCDR (value);
2110 else if (EQ (parameter, Qdisplay_type))
2111 /* Avoid consing in a frequent case. */
2112 value = Qnil;
2113 else
2114 value = Fcdr (Fassq (parameter, Fframe_parameters (frame)));
2115 }
2116
2117 return value;
2118 }
2119
2120
2083 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters, 2121 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters,
2084 Smodify_frame_parameters, 2, 2, 0, 2122 Smodify_frame_parameters, 2, 2, 0,
2085 "Modify the parameters of frame FRAME according to ALIST.\n\ 2123 "Modify the parameters of frame FRAME according to ALIST.\n\
2086 ALIST is an alist of parameters to change and their new values.\n\ 2124 ALIST is an alist of parameters to change and their new values.\n\
2087 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\ 2125 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\
2427 defsubr (&Sraise_frame); 2465 defsubr (&Sraise_frame);
2428 defsubr (&Slower_frame); 2466 defsubr (&Slower_frame);
2429 defsubr (&Sredirect_frame_focus); 2467 defsubr (&Sredirect_frame_focus);
2430 defsubr (&Sframe_focus); 2468 defsubr (&Sframe_focus);
2431 defsubr (&Sframe_parameters); 2469 defsubr (&Sframe_parameters);
2470 defsubr (&Sframe_parameter);
2432 defsubr (&Smodify_frame_parameters); 2471 defsubr (&Smodify_frame_parameters);
2433 defsubr (&Sframe_char_height); 2472 defsubr (&Sframe_char_height);
2434 defsubr (&Sframe_char_width); 2473 defsubr (&Sframe_char_width);
2435 defsubr (&Sframe_pixel_height); 2474 defsubr (&Sframe_pixel_height);
2436 defsubr (&Sframe_pixel_width); 2475 defsubr (&Sframe_pixel_width);