diff options
| author | Gerd Moellmann | 2000-09-05 15:53:29 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-09-05 15:53:29 +0000 |
| commit | 8b60f7bcd920f82edb95d3ef7170297f7a27c1fe (patch) | |
| tree | 74e57559d8c9057bf1016029d7dd09b38e4ec08a | |
| parent | 3b4429b49044779568646320f55fec9e2ff3e9cc (diff) | |
| download | emacs-8b60f7bcd920f82edb95d3ef7170297f7a27c1fe.tar.gz emacs-8b60f7bcd920f82edb95d3ef7170297f7a27c1fe.zip | |
(Qdisplay_type): New variable.
(syms_of_frame_1): Initialize it.
(Fframe_parameter): New function that avoids consing.
(syms_of_frame): Defsubr it.
| -rw-r--r-- | src/frame.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c index 714aaad9d77..8462a0c1d67 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -104,6 +104,7 @@ 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; |
| @@ -153,6 +154,8 @@ syms_of_frame_1 () | |||
| 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\ |
| @@ -2080,6 +2083,41 @@ If FRAME is omitted, return information on the currently selected frame.") | |||
| 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\ |
| @@ -2429,6 +2467,7 @@ displayed."); | |||
| 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); |