Mercurial > emacs
annotate src/frame.c @ 1437:36ef55ecb265
* frame.c (make_frame_without_minibuffer, Fwindow_frame): Use
CHECK_LIVE_WINDOW instead of CHECK_WINDOW.
* sunfns.c (Fsun_menu_internal): Same.
* xmenu.c (Fx_popup_menu): Same.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Mon, 19 Oct 1992 18:33:14 +0000 |
parents | a4a205bdd2c1 |
children | ceaecac6bf2e |
rev | line source |
---|---|
765 | 1 /* Generic frame functions. |
708 | 2 Copyright (C) 1989, 1992 Free Software Foundation. |
286 | 3 |
4 This file is part of GNU Emacs. | |
5 | |
6 GNU Emacs is free software; you can redistribute it and/or modify | |
7 it under the terms of the GNU General Public License as published by | |
708 | 8 the Free Software Foundation; either version 2, or (at your option) |
286 | 9 any later version. |
10 | |
11 GNU Emacs is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with GNU Emacs; see the file COPYING. If not, write to | |
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | |
363 | 20 #include <stdio.h> |
21 | |
286 | 22 #include "config.h" |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
23 #include "lisp.h" |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
24 #include "frame.h" |
732 | 25 |
765 | 26 #ifdef MULTI_FRAME |
732 | 27 |
286 | 28 #include "window.h" |
363 | 29 #include "termhooks.h" |
286 | 30 |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
31 /* These help us bind and responding to switch-frame events. */ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
32 #include "commands.h" |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
33 #include "keyboard.h" |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
34 |
286 | 35 Lisp_Object Vemacs_iconified; |
765 | 36 Lisp_Object Vframe_list; |
37 Lisp_Object Vterminal_frame; | |
38 Lisp_Object Vdefault_minibuffer_frame; | |
39 Lisp_Object Vdefault_frame_alist; | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
40 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
41 /* Evaluate this expression to rebuild the section of syms_of_frame |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
42 that initializes and staticpros the symbols declared below. Note |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
43 that Emacs 18 has a bug that keeps C-x C-e from being able to |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
44 evaluate this expression. |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
45 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
46 (progn |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
47 ;; Accumulate a list of the symbols we want to initialize from the |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
48 ;; declarations at the top of the file. |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
49 (goto-char (point-min)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
50 (search-forward "/\*&&& symbols declared here &&&*\/\n") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
51 (let (symbol-list) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
52 (while (looking-at "Lisp_Object \\(Q[a-z_]+\\)") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
53 (setq symbol-list |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
54 (cons (buffer-substring (match-beginning 1) (match-end 1)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
55 symbol-list)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
56 (forward-line 1)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
57 (setq symbol-list (nreverse symbol-list)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
58 ;; Delete the section of syms_of_... where we initialize the symbols. |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
59 (search-forward "\n /\*&&& init symbols here &&&*\/\n") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
60 (let ((start (point))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
61 (while (looking-at "^ Q") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
62 (forward-line 2)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
63 (kill-region start (point))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
64 ;; Write a new symbol initialization section. |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
65 (while symbol-list |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
66 (insert (format " %s = intern (\"" (car symbol-list))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
67 (let ((start (point))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
68 (insert (substring (car symbol-list) 1)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
69 (subst-char-in-region start (point) ?_ ?-)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
70 (insert (format "\");\n staticpro (&%s);\n" (car symbol-list))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
71 (setq symbol-list (cdr symbol-list))))) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
72 */ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
73 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
74 /*&&& symbols declared here &&&*/ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
75 Lisp_Object Qframep; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
76 Lisp_Object Qlive_frame_p; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
77 Lisp_Object Qheight; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
78 Lisp_Object Qicon; |
539 | 79 Lisp_Object Qminibuffer; |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
80 Lisp_Object Qmodeline; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
81 Lisp_Object Qname; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
82 Lisp_Object Qnone; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
83 Lisp_Object Qonly; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
84 Lisp_Object Qunsplittable; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
85 Lisp_Object Qwidth; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
86 Lisp_Object Qx; |
286 | 87 |
88 extern Lisp_Object Vminibuffer_list; | |
89 extern Lisp_Object get_minibuffer (); | |
90 | |
765 | 91 DEFUN ("framep", Fframep, Sframep, 1, 1, 0, |
92 "Return non-nil if OBJECT is a frame.\n\ | |
93 Value is t for a termcap frame (a character-only terminal),\n\ | |
94 `x' for an Emacs frame that is really an X window.\n\ | |
95 Also see `live-frame-p'.") | |
454 | 96 (object) |
97 Lisp_Object object; | |
286 | 98 { |
765 | 99 if (XTYPE (object) != Lisp_Frame) |
286 | 100 return Qnil; |
765 | 101 switch (XFRAME (object)->output_method) |
286 | 102 { |
103 case output_termcap: | |
104 return Qt; | |
105 case output_x_window: | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
106 return Qx; |
286 | 107 default: |
108 abort (); | |
109 } | |
110 } | |
111 | |
765 | 112 DEFUN ("live-frame-p", Flive_frame_p, Slive_frame_p, 1, 1, 0, |
113 "Return non-nil if OBJECT is a frame which has not been deleted.\n\ | |
114 Value is nil if OBJECT is not a live frame. If object is a live\n\ | |
115 frame, the return value indicates what sort of output device it is\n\ | |
116 displayed on. Value is t for a termcap frame (a character-only\n\ | |
117 terminal), `x' for an Emacs frame being displayed in an X window.") | |
454 | 118 (object) |
119 Lisp_Object object; | |
120 { | |
765 | 121 return ((FRAMEP (object) |
122 && FRAME_LIVE_P (XFRAME (object))) | |
123 ? Fframep (object) | |
454 | 124 : Qnil); |
125 } | |
126 | |
765 | 127 struct frame * |
128 make_frame (mini_p) | |
286 | 129 int mini_p; |
130 { | |
765 | 131 Lisp_Object frame; |
132 register struct frame *f; | |
286 | 133 register Lisp_Object root_window; |
134 register Lisp_Object mini_window; | |
135 | |
765 | 136 frame = Fmake_vector (((sizeof (struct frame) - (sizeof (Lisp_Vector) |
363 | 137 - sizeof (Lisp_Object))) |
138 / sizeof (Lisp_Object)), | |
286 | 139 make_number (0)); |
765 | 140 XSETTYPE (frame, Lisp_Frame); |
141 f = XFRAME (frame); | |
286 | 142 |
765 | 143 f->cursor_x = 0; |
144 f->cursor_y = 0; | |
145 f->current_glyphs = 0; | |
146 f->desired_glyphs = 0; | |
147 f->visible = 0; | |
148 f->display.nothing = 0; | |
149 f->iconified = 0; | |
150 f->wants_modeline = 1; | |
151 f->auto_raise = 0; | |
152 f->auto_lower = 0; | |
153 f->no_split = 0; | |
154 f->garbaged = 0; | |
155 f->has_minibuffer = mini_p; | |
156 f->focus_frame = frame; | |
1006
a13ee72d74a2
* frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents:
987
diff
changeset
|
157 f->explicit_name = 0; |
286 | 158 |
765 | 159 f->param_alist = Qnil; |
286 | 160 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
161 root_window = make_window (); |
286 | 162 if (mini_p) |
163 { | |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
164 mini_window = make_window (); |
286 | 165 XWINDOW (root_window)->next = mini_window; |
166 XWINDOW (mini_window)->prev = root_window; | |
167 XWINDOW (mini_window)->mini_p = Qt; | |
765 | 168 XWINDOW (mini_window)->frame = frame; |
169 f->minibuffer_window = mini_window; | |
286 | 170 } |
171 else | |
172 { | |
173 mini_window = Qnil; | |
174 XWINDOW (root_window)->next = Qnil; | |
765 | 175 f->minibuffer_window = Qnil; |
286 | 176 } |
177 | |
765 | 178 XWINDOW (root_window)->frame = frame; |
286 | 179 |
180 /* 10 is arbitrary, | |
181 just so that there is "something there." | |
765 | 182 Correct size will be set up later with change_frame_size. */ |
286 | 183 |
765 | 184 f->width = 10; |
185 f->height = 10; | |
286 | 186 |
187 XFASTINT (XWINDOW (root_window)->width) = 10; | |
188 XFASTINT (XWINDOW (root_window)->height) = (mini_p ? 9 : 10); | |
189 | |
190 if (mini_p) | |
191 { | |
192 XFASTINT (XWINDOW (mini_window)->width) = 10; | |
193 XFASTINT (XWINDOW (mini_window)->top) = 9; | |
194 XFASTINT (XWINDOW (mini_window)->height) = 1; | |
195 } | |
196 | |
765 | 197 /* Choose a buffer for the frame's root window. */ |
386 | 198 { |
199 Lisp_Object buf; | |
200 | |
201 XWINDOW (root_window)->buffer = Qt; | |
202 buf = Fcurrent_buffer (); | |
203 /* If buf is a 'hidden' buffer (i.e. one whose name starts with | |
204 a space), try to find another one. */ | |
205 if (XSTRING (Fbuffer_name (buf))->data[0] == ' ') | |
1346
5e27c3e71a78
(make_frame): Pass 2nd arg to Fother_buffer.
Richard M. Stallman <rms@gnu.org>
parents:
1260
diff
changeset
|
206 buf = Fother_buffer (buf, Qnil); |
386 | 207 Fset_window_buffer (root_window, buf); |
208 } | |
209 | |
286 | 210 if (mini_p) |
211 { | |
212 XWINDOW (mini_window)->buffer = Qt; | |
213 Fset_window_buffer (mini_window, | |
485 | 214 (NILP (Vminibuffer_list) |
286 | 215 ? get_minibuffer (0) |
216 : Fcar (Vminibuffer_list))); | |
217 } | |
218 | |
765 | 219 f->root_window = root_window; |
220 f->selected_window = root_window; | |
363 | 221 /* Make sure this window seems more recently used than |
222 a newly-created, never-selected window. */ | |
765 | 223 XFASTINT (XWINDOW (f->selected_window)->use_time) = ++window_select_count; |
286 | 224 |
765 | 225 Vframe_list = Fcons (frame, Vframe_list); |
286 | 226 |
765 | 227 return f; |
286 | 228 } |
229 | |
765 | 230 /* Make a frame using a separate minibuffer window on another frame. |
286 | 231 MINI_WINDOW is the minibuffer window to use. nil means use the |
232 default (the global minibuffer). */ | |
233 | |
765 | 234 struct frame * |
235 make_frame_without_minibuffer (mini_window) | |
286 | 236 register Lisp_Object mini_window; |
237 { | |
765 | 238 register struct frame *f; |
286 | 239 |
240 /* Choose the minibuffer window to use. */ | |
485 | 241 if (NILP (mini_window)) |
286 | 242 { |
765 | 243 if (XTYPE (Vdefault_minibuffer_frame) != Lisp_Frame) |
244 error ("default-minibuffer-frame must be set when creating minibufferless frames"); | |
245 if (! FRAME_LIVE_P (XFRAME (Vdefault_minibuffer_frame))) | |
246 error ("default-minibuffer-frame must be a live frame"); | |
247 mini_window = XFRAME (Vdefault_minibuffer_frame)->minibuffer_window; | |
286 | 248 } |
249 else | |
250 { | |
1437
36ef55ecb265
* frame.c (make_frame_without_minibuffer, Fwindow_frame): Use
Jim Blandy <jimb@redhat.com>
parents:
1385
diff
changeset
|
251 CHECK_LIVE_WINDOW (mini_window, 0); |
286 | 252 } |
253 | |
765 | 254 /* Make a frame containing just a root window. */ |
255 f = make_frame (0); | |
286 | 256 |
257 /* Install the chosen minibuffer window, with proper buffer. */ | |
765 | 258 f->minibuffer_window = mini_window; |
286 | 259 Fset_window_buffer (mini_window, |
485 | 260 (NILP (Vminibuffer_list) |
286 | 261 ? get_minibuffer (0) |
262 : Fcar (Vminibuffer_list))); | |
765 | 263 return f; |
286 | 264 } |
265 | |
765 | 266 /* Make a frame containing only a minibuffer window. */ |
286 | 267 |
765 | 268 struct frame * |
269 make_minibuffer_frame () | |
286 | 270 { |
765 | 271 /* First make a frame containing just a root window, no minibuffer. */ |
286 | 272 |
765 | 273 register struct frame *f = make_frame (0); |
286 | 274 register Lisp_Object mini_window; |
765 | 275 register Lisp_Object frame; |
286 | 276 |
765 | 277 XSET (frame, Lisp_Frame, f); |
286 | 278 |
1006
a13ee72d74a2
* frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents:
987
diff
changeset
|
279 f->auto_raise = 0; |
765 | 280 f->auto_lower = 0; |
281 f->no_split = 1; | |
282 f->wants_modeline = 0; | |
283 f->has_minibuffer = 1; | |
286 | 284 |
285 /* Now label the root window as also being the minibuffer. | |
286 Avoid infinite looping on the window chain by marking next pointer | |
287 as nil. */ | |
288 | |
765 | 289 mini_window = f->minibuffer_window = f->root_window; |
286 | 290 XWINDOW (mini_window)->mini_p = Qt; |
291 XWINDOW (mini_window)->next = Qnil; | |
1006
a13ee72d74a2
* frame.c (make_frame): Clear the explicit_name member of the new
Jim Blandy <jimb@redhat.com>
parents:
987
diff
changeset
|
292 XWINDOW (mini_window)->prev = Qnil; |
765 | 293 XWINDOW (mini_window)->frame = frame; |
286 | 294 |
295 /* Put the proper buffer in that window. */ | |
296 | |
297 Fset_window_buffer (mini_window, | |
485 | 298 (NILP (Vminibuffer_list) |
286 | 299 ? get_minibuffer (0) |
300 : Fcar (Vminibuffer_list))); | |
765 | 301 return f; |
286 | 302 } |
303 | |
765 | 304 /* Construct a frame that refers to the terminal (stdin and stdout). */ |
286 | 305 |
765 | 306 struct frame * |
307 make_terminal_frame () | |
286 | 308 { |
765 | 309 register struct frame *f; |
286 | 310 |
765 | 311 Vframe_list = Qnil; |
312 f = make_frame (1); | |
313 f->name = build_string ("terminal"); | |
314 f->visible = 1; | |
315 f->display.nothing = 1; /* Nonzero means frame isn't deleted. */ | |
316 XSET (Vterminal_frame, Lisp_Frame, f); | |
317 return f; | |
286 | 318 } |
319 | |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
320 DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e", |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
321 "Select the frame FRAME. FRAME's selected window becomes \"the\"\n\ |
363 | 322 selected window. If the optional parameter NO-ENTER is non-nil, don't\n\ |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
323 focus on that frame.\n\ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
324 \n\ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
325 This function is interactive, and may be bound to the ``switch-frame''\n\ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
326 event; when invoked this way, it switches to the frame named in the\n\ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
327 event. When called from lisp, FRAME may be a ``switch-frame'' event;\n\ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
328 if it is, select the frame named in the event.") |
765 | 329 (frame, no_enter) |
330 Lisp_Object frame, no_enter; | |
286 | 331 { |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
332 /* If FRAME is a switch-frame event, extract the frame we should |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
333 switch to. */ |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
334 if (CONSP (frame) |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
335 && EQ (XCONS (frame)->car, Qswitch_frame) |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
336 && CONSP (XCONS (frame)->cdr)) |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
337 frame = XCONS (XCONS (frame)->cdr)->car; |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
338 |
765 | 339 CHECK_LIVE_FRAME (frame, 0); |
286 | 340 |
765 | 341 if (selected_frame == XFRAME (frame)) |
342 return frame; | |
286 | 343 |
765 | 344 selected_frame = XFRAME (frame); |
345 if (! FRAME_MINIBUF_ONLY_P (selected_frame)) | |
346 last_nonminibuf_frame = selected_frame; | |
363 | 347 |
765 | 348 Fselect_window (XFRAME (frame)->selected_window); |
286 | 349 |
350 #ifdef HAVE_X_WINDOWS | |
765 | 351 #ifdef MULTI_FRAME |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
352 if (FRAME_X_P (XFRAME (frame)) |
485 | 353 && NILP (no_enter)) |
286 | 354 { |
765 | 355 Ffocus_frame (frame); |
286 | 356 } |
357 #endif | |
358 #endif | |
765 | 359 choose_minibuf_frame (); |
286 | 360 |
765 | 361 return frame; |
286 | 362 } |
363 | |
765 | 364 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0, |
365 "Return the frame that is now selected.") | |
286 | 366 () |
367 { | |
368 Lisp_Object tem; | |
765 | 369 XSET (tem, Lisp_Frame, selected_frame); |
286 | 370 return tem; |
371 } | |
372 | |
765 | 373 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0, |
374 "Return the frame object that window WINDOW is on.") | |
286 | 375 (window) |
376 Lisp_Object window; | |
377 { | |
1437
36ef55ecb265
* frame.c (make_frame_without_minibuffer, Fwindow_frame): Use
Jim Blandy <jimb@redhat.com>
parents:
1385
diff
changeset
|
378 CHECK_LIVE_WINDOW (window, 0); |
765 | 379 return XWINDOW (window)->frame; |
286 | 380 } |
381 | |
765 | 382 DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0, |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
383 "Returns the root-window of FRAME.\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
384 If omitted, FRAME defaults to the currently selected frame.") |
765 | 385 (frame) |
386 Lisp_Object frame; | |
286 | 387 { |
765 | 388 if (NILP (frame)) |
389 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 390 else |
765 | 391 CHECK_LIVE_FRAME (frame, 0); |
286 | 392 |
765 | 393 return XFRAME (frame)->root_window; |
286 | 394 } |
395 | |
765 | 396 DEFUN ("frame-selected-window", Fframe_selected_window, |
397 Sframe_selected_window, 0, 1, 0, | |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
398 "Return the selected window of frame object FRAME.\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
399 If omitted, FRAME defaults to the currently selected frame.") |
765 | 400 (frame) |
401 Lisp_Object frame; | |
286 | 402 { |
765 | 403 if (NILP (frame)) |
404 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 405 else |
765 | 406 CHECK_LIVE_FRAME (frame, 0); |
286 | 407 |
765 | 408 return XFRAME (frame)->selected_window; |
286 | 409 } |
410 | |
765 | 411 DEFUN ("frame-list", Fframe_list, Sframe_list, |
286 | 412 0, 0, 0, |
765 | 413 "Return a list of all frames.") |
286 | 414 () |
415 { | |
765 | 416 return Fcopy_sequence (Vframe_list); |
286 | 417 } |
418 | |
765 | 419 #ifdef MULTI_FRAME |
454 | 420 |
765 | 421 /* Return the next frame in the frame list after FRAME. |
422 If MINIBUF is nil, exclude minibuffer-only frames. | |
423 If MINIBUF is a window, include only frames using that window for | |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
424 their minibuffer. |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
425 If MINIBUF is non-nil, and not a window, include all frames. */ |
286 | 426 Lisp_Object |
765 | 427 next_frame (frame, minibuf) |
428 Lisp_Object frame; | |
454 | 429 Lisp_Object minibuf; |
286 | 430 { |
431 Lisp_Object tail; | |
432 int passed = 0; | |
433 | |
765 | 434 /* There must always be at least one frame in Vframe_list. */ |
435 if (! CONSP (Vframe_list)) | |
454 | 436 abort (); |
437 | |
286 | 438 while (1) |
765 | 439 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
286 | 440 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
441 Lisp_Object f = XCONS (tail)->car; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
442 |
286 | 443 if (passed) |
363 | 444 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
445 /* Decide whether this frame is eligible to be returned. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
446 |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
447 /* If we've looped all the way around without finding any |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
448 eligible frames, return the original frame. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
449 if (EQ (f, frame)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
450 return f; |
335 | 451 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
452 /* Let minibuf decide if this frame is acceptable. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
453 if (NILP (minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
454 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
455 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f))) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
456 return f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
457 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
458 else if (XTYPE (minibuf) == Lisp_Window) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
459 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
460 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
461 return f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
462 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
463 else |
765 | 464 return f; |
363 | 465 } |
286 | 466 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
467 if (EQ (frame, f)) |
286 | 468 passed++; |
469 } | |
470 } | |
471 | |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
472 #if 0 |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
473 /* Nobody seems to be using this code right now. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
474 |
765 | 475 /* Return the previous frame in the frame list before FRAME. |
476 If MINIBUF is nil, exclude minibuffer-only frames. | |
477 If MINIBUF is a window, include only frames using that window for | |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
478 their minibuffer. |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
479 If MINIBUF is non-nil and not a window, include all frames. */ |
286 | 480 Lisp_Object |
765 | 481 prev_frame (frame, minibuf) |
482 Lisp_Object frame; | |
454 | 483 Lisp_Object minibuf; |
286 | 484 { |
485 Lisp_Object tail; | |
486 Lisp_Object prev; | |
487 | |
765 | 488 /* There must always be at least one frame in Vframe_list. */ |
489 if (! CONSP (Vframe_list)) | |
454 | 490 abort (); |
491 | |
286 | 492 prev = Qnil; |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
493 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
454 | 494 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
495 Lisp_Object f = XCONS (tail)->car; |
454 | 496 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
497 if (XTYPE (f) != Lisp_Frame) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
498 abort (); |
454 | 499 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
500 if (EQ (frame, f) && !NILP (prev)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
501 return prev; |
454 | 502 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
503 /* Decide whether this frame is eligible to be returned, |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
504 according to minibuf. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
505 if (NILP (minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
506 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
507 if (! FRAME_MINIBUF_ONLY_P (XFRAME (f))) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
508 prev = f; |
454 | 509 } |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
510 else if (XTYPE (minibuf) == Lisp_Window) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
511 { |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
512 if (EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
513 prev = f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
514 } |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
515 else |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
516 prev = f; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
517 } |
454 | 518 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
519 /* We've scanned the entire list. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
520 if (NILP (prev)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
521 /* We went through the whole frame list without finding a single |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
522 acceptable frame. Return the original frame. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
523 return frame; |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
524 else |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
525 /* There were no acceptable frames in the list before FRAME; otherwise, |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
526 we would have returned directly from the loop. Since PREV is the last |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
527 acceptable frame in the list, return it. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
528 return prev; |
286 | 529 } |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
530 #endif |
286 | 531 |
765 | 532 DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0, |
533 "Return the next frame in the frame list after FRAME.\n\ | |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
534 By default, skip minibuffer-only frames. |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
535 If omitted, FRAME defaults to the selected frame.\n\ |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
536 If optional argument MINIFRAME is non-nil, include minibuffer-only frames.\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
537 If MINIFRAME is a window, include only frames using that window for their\n\ |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
538 minibuffer.\n\ |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
539 If MINIFRAME is non-nil and not a window, include all frames.") |
765 | 540 (frame, miniframe) |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
541 Lisp_Object frame, miniframe; |
286 | 542 { |
543 Lisp_Object tail; | |
544 | |
765 | 545 if (NILP (frame)) |
546 XSET (frame, Lisp_Frame, selected_frame); | |
454 | 547 else |
765 | 548 CHECK_LIVE_FRAME (frame, 0); |
286 | 549 |
765 | 550 return next_frame (frame, miniframe); |
286 | 551 } |
765 | 552 #endif /* MULTI_FRAME */ |
286 | 553 |
765 | 554 DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 1, "", |
555 "Delete FRAME, permanently eliminating it from use.\n\ | |
556 If omitted, FRAME defaults to the selected frame.\n\ | |
557 A frame may not be deleted if its minibuffer is used by other frames.") | |
558 (frame) | |
559 Lisp_Object frame; | |
286 | 560 { |
765 | 561 struct frame *f; |
286 | 562 union display displ; |
563 | |
765 | 564 if (EQ (frame, Qnil)) |
286 | 565 { |
765 | 566 f = selected_frame; |
567 XSET (frame, Lisp_Frame, f); | |
286 | 568 } |
569 else | |
570 { | |
765 | 571 CHECK_FRAME (frame, 0); |
572 f = XFRAME (frame); | |
286 | 573 } |
574 | |
765 | 575 if (! FRAME_LIVE_P (f)) |
454 | 576 return; |
577 | |
765 | 578 /* Are there any other frames besides this one? */ |
579 if (f == selected_frame && EQ (next_frame (frame, Qt), frame)) | |
580 error ("Attempt to delete the only frame"); | |
286 | 581 |
765 | 582 /* Does this frame have a minibuffer, and is it the surrogate |
583 minibuffer for any other frame? */ | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
584 if (FRAME_HAS_MINIBUF_P (XFRAME (frame))) |
363 | 585 { |
765 | 586 Lisp_Object frames; |
708 | 587 |
765 | 588 for (frames = Vframe_list; |
589 CONSP (frames); | |
590 frames = XCONS (frames)->cdr) | |
708 | 591 { |
765 | 592 Lisp_Object this = XCONS (frames)->car; |
363 | 593 |
765 | 594 if (! EQ (this, frame) |
595 && EQ (frame, | |
596 (WINDOW_FRAME | |
708 | 597 (XWINDOW |
765 | 598 (FRAME_MINIBUF_WINDOW |
599 (XFRAME (this))))))) | |
600 error ("Attempt to delete a surrogate minibuffer frame"); | |
708 | 601 } |
286 | 602 } |
603 | |
765 | 604 /* Don't let the frame remain selected. */ |
605 if (f == selected_frame) | |
1260
a2d017a57391
* frame.c (Fdelete_frame): Call Fselect_frame with the appropriate
Jim Blandy <jimb@redhat.com>
parents:
1251
diff
changeset
|
606 Fselect_frame (next_frame (frame, Qt), Qnil); |
286 | 607 |
765 | 608 /* Don't allow minibuf_window to remain on a deleted frame. */ |
609 if (EQ (f->minibuffer_window, minibuf_window)) | |
286 | 610 { |
765 | 611 Fset_window_buffer (selected_frame->minibuffer_window, |
286 | 612 XWINDOW (minibuf_window)->buffer); |
765 | 613 minibuf_window = selected_frame->minibuffer_window; |
286 | 614 } |
615 | |
765 | 616 Vframe_list = Fdelq (frame, Vframe_list); |
617 f->visible = 0; | |
618 displ = f->display; | |
619 f->display.nothing = 0; | |
286 | 620 |
363 | 621 #ifdef HAVE_X_WINDOWS |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
622 if (FRAME_X_P (f)) |
765 | 623 x_destroy_window (f, displ); |
363 | 624 #endif |
625 | |
765 | 626 /* If we've deleted the last_nonminibuf_frame, then try to find |
363 | 627 another one. */ |
765 | 628 if (f == last_nonminibuf_frame) |
363 | 629 { |
765 | 630 Lisp_Object frames; |
708 | 631 |
765 | 632 last_nonminibuf_frame = 0; |
363 | 633 |
765 | 634 for (frames = Vframe_list; |
635 CONSP (frames); | |
636 frames = XCONS (frames)->cdr) | |
363 | 637 { |
765 | 638 f = XFRAME (XCONS (frames)->car); |
639 if (!FRAME_MINIBUF_ONLY_P (f)) | |
363 | 640 { |
765 | 641 last_nonminibuf_frame = f; |
363 | 642 break; |
643 } | |
644 } | |
645 } | |
286 | 646 |
765 | 647 /* If we've deleted Vdefault_minibuffer_frame, try to find another |
648 one. Prefer minibuffer-only frames, but also notice frames | |
708 | 649 with other windows. */ |
765 | 650 if (EQ (frame, Vdefault_minibuffer_frame)) |
708 | 651 { |
765 | 652 Lisp_Object frames; |
708 | 653 |
765 | 654 /* The last frame we saw with a minibuffer, minibuffer-only or not. */ |
655 Lisp_Object frame_with_minibuf = Qnil; | |
708 | 656 |
765 | 657 for (frames = Vframe_list; |
658 CONSP (frames); | |
659 frames = XCONS (frames)->cdr) | |
708 | 660 { |
765 | 661 Lisp_Object this = XCONS (frames)->car; |
708 | 662 |
765 | 663 if (XTYPE (this) != Lisp_Frame) |
708 | 664 abort (); |
765 | 665 f = XFRAME (this); |
708 | 666 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
667 if (FRAME_HAS_MINIBUF_P (f)) |
708 | 668 { |
765 | 669 frame_with_minibuf = this; |
670 if (FRAME_MINIBUF_ONLY_P (f)) | |
708 | 671 break; |
672 } | |
673 } | |
674 | |
765 | 675 /* We know that there must be some frame with a minibuffer out |
676 there. If this were not true, all of the frames present | |
708 | 677 would have to be minibufferless, which implies that at some |
765 | 678 point their minibuffer frames must have been deleted, but |
708 | 679 that is prohibited at the top; you can't delete surrogate |
765 | 680 minibuffer frames. */ |
681 if (NILP (frame_with_minibuf)) | |
708 | 682 abort (); |
683 | |
765 | 684 Vdefault_minibuffer_frame = frame_with_minibuf; |
708 | 685 } |
686 | |
286 | 687 return Qnil; |
688 } | |
689 | |
690 /* Return mouse position in character cell units. */ | |
691 | |
454 | 692 DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, |
765 | 693 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\ |
454 | 694 If Emacs is running on a mouseless terminal or hasn't been programmed\n\ |
765 | 695 to read the mouse position, it returns the selected frame for FRAME\n\ |
454 | 696 and nil for X and Y.") |
697 () | |
286 | 698 { |
454 | 699 Lisp_Object x, y, dummy; |
765 | 700 FRAME_PTR f; |
286 | 701 |
454 | 702 if (mouse_position_hook) |
765 | 703 (*mouse_position_hook) (&f, &x, &y, &dummy); |
454 | 704 else |
705 { | |
765 | 706 f = selected_frame; |
454 | 707 x = y = Qnil; |
708 } | |
286 | 709 |
765 | 710 XSET (dummy, Lisp_Frame, f); |
454 | 711 return Fcons (dummy, Fcons (make_number (x), make_number (y))); |
286 | 712 } |
713 | |
714 DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0, | |
765 | 715 "Move the mouse pointer to the center of cell (X,Y) in FRAME.\n\ |
716 WARNING: If you use this under X, you should do `unfocus-frame' afterwards.") | |
717 (frame, x, y) | |
718 Lisp_Object frame, x, y; | |
286 | 719 { |
765 | 720 CHECK_LIVE_FRAME (frame, 0); |
286 | 721 CHECK_NUMBER (x, 2); |
722 CHECK_NUMBER (y, 1); | |
723 | |
724 #ifdef HAVE_X_WINDOWS | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
725 if (FRAME_X_P (XFRAME (frame))) |
286 | 726 /* Warping the mouse will cause enternotify and focus events. */ |
765 | 727 x_set_mouse_position (XFRAME (frame), x, y); |
286 | 728 #endif |
729 | |
730 return Qnil; | |
731 } | |
732 | |
733 #if 0 | |
734 /* ??? Can this be replaced with a Lisp function? | |
756 | 735 It is used in minibuf.c. Can we get rid of that? |
736 Yes. All uses in minibuf.c are gone, and parallels to these | |
765 | 737 functions have been defined in frame.el. */ |
286 | 738 |
765 | 739 DEFUN ("frame-configuration", Fframe_configuration, Sframe_configuration, |
286 | 740 0, 0, 0, |
765 | 741 "Return object describing current frame configuration.\n\ |
742 The frame configuration is the current mouse position and selected frame.\n\ | |
743 This object can be given to `restore-frame-configuration'\n\ | |
744 to restore this frame configuration.") | |
286 | 745 () |
746 { | |
454 | 747 Lisp_Object c, time; |
286 | 748 |
454 | 749 c = Fmake_vector (make_number(4), Qnil); |
765 | 750 XVECTOR (c)->contents[0] = Fselected_frame(); |
454 | 751 if (mouse_position_hook) |
752 (*mouse_position_hook) (&XVECTOR (c)->contents[1] | |
753 &XVECTOR (c)->contents[2], | |
754 &XVECTOR (c)->contents[3], | |
755 &time); | |
286 | 756 return c; |
757 } | |
758 | |
765 | 759 DEFUN ("restore-frame-configuration", Frestore_frame_configuration, |
760 Srestore_frame_configuration, | |
286 | 761 1, 1, 0, |
765 | 762 "Restores frame configuration CONFIGURATION.") |
286 | 763 (config) |
764 Lisp_Object config; | |
765 { | |
765 | 766 Lisp_Object x_pos, y_pos, frame; |
286 | 767 |
768 CHECK_VECTOR (config, 0); | |
769 if (XVECTOR (config)->size != 3) | |
770 { | |
765 | 771 error ("Wrong size vector passed to restore-frame-configuration"); |
286 | 772 } |
765 | 773 frame = XVECTOR (config)->contents[0]; |
774 CHECK_LIVE_FRAME (frame, 0); | |
286 | 775 |
765 | 776 Fselect_frame (frame, Qnil); |
286 | 777 |
778 #if 0 | |
765 | 779 /* This seems to interfere with the frame selection mechanism. jla */ |
454 | 780 x_pos = XVECTOR (config)->contents[2]; |
781 y_pos = XVECTOR (config)->contents[3]; | |
765 | 782 set_mouse_position (frame, XINT (x_pos), XINT (y_pos)); |
286 | 783 #endif |
784 | |
765 | 785 return frame; |
286 | 786 } |
787 #endif | |
788 | |
765 | 789 DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible, |
872 | 790 0, 1, 0, |
765 | 791 "Make the frame FRAME visible (assuming it is an X-window).\n\ |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
792 Also raises the frame so that nothing obscures it.\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
793 If omitted, FRAME defaults to the currently selected frame.") |
765 | 794 (frame) |
795 Lisp_Object frame; | |
286 | 796 { |
872 | 797 if (NILP (frame)) |
886 | 798 XSET (frame, Lisp_Frame, selected_frame); |
872 | 799 |
765 | 800 CHECK_LIVE_FRAME (frame, 0); |
286 | 801 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
802 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
803 if (FRAME_X_P (XFRAME (frame))) |
765 | 804 x_make_frame_visible (XFRAME (frame)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
805 #endif |
286 | 806 |
765 | 807 return frame; |
286 | 808 } |
809 | |
765 | 810 DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible, |
872 | 811 0, 1, "", |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
812 "Make the frame FRAME invisible (assuming it is an X-window).\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
813 If omitted, FRAME defaults to the currently selected frame.") |
765 | 814 (frame) |
815 Lisp_Object frame; | |
286 | 816 { |
872 | 817 if (NILP (frame)) |
886 | 818 XSET (frame, Lisp_Frame, selected_frame); |
872 | 819 |
765 | 820 CHECK_LIVE_FRAME (frame, 0); |
286 | 821 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
822 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
823 if (FRAME_X_P (XFRAME (frame))) |
765 | 824 x_make_frame_invisible (XFRAME (frame)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
825 #endif |
286 | 826 |
827 return Qnil; | |
828 } | |
829 | |
765 | 830 DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame, |
872 | 831 0, 1, "", |
1251
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
832 "Make the frame FRAME into an icon.\n\ |
4e556fda7a4d
* frame.c (Fselect_frame, Fframe_root_window,
Jim Blandy <jimb@redhat.com>
parents:
1118
diff
changeset
|
833 If omitted, FRAME defaults to the currently selected frame.") |
765 | 834 (frame) |
835 Lisp_Object frame; | |
286 | 836 { |
872 | 837 if (NILP (frame)) |
886 | 838 XSET (frame, Lisp_Frame, selected_frame); |
872 | 839 |
765 | 840 CHECK_LIVE_FRAME (frame, 0); |
286 | 841 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
842 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
843 if (FRAME_X_P (XFRAME (frame))) |
765 | 844 x_iconify_frame (XFRAME (frame)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
845 #endif |
286 | 846 |
847 return Qnil; | |
848 } | |
849 | |
765 | 850 DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p, |
286 | 851 1, 1, 0, |
765 | 852 "Return t if FRAME is now \"visible\" (actually in use for display).\n\ |
853 A frame that is not \"visible\" is not updated and, if it works through\n\ | |
286 | 854 a window system, it may not show at all.\n\ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
855 Return the symbol `icon' if frame is visible only as an icon.") |
765 | 856 (frame) |
857 Lisp_Object frame; | |
286 | 858 { |
765 | 859 CHECK_LIVE_FRAME (frame, 0); |
286 | 860 |
765 | 861 if (XFRAME (frame)->visible) |
286 | 862 return Qt; |
765 | 863 if (XFRAME (frame)->iconified) |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
864 return Qicon; |
286 | 865 return Qnil; |
866 } | |
867 | |
765 | 868 DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list, |
286 | 869 0, 0, 0, |
765 | 870 "Return a list of all frames now \"visible\" (being updated).") |
286 | 871 () |
872 { | |
765 | 873 Lisp_Object tail, frame; |
874 struct frame *f; | |
286 | 875 Lisp_Object value; |
876 | |
877 value = Qnil; | |
765 | 878 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) |
286 | 879 { |
765 | 880 frame = XCONS (tail)->car; |
881 if (XTYPE (frame) != Lisp_Frame) | |
286 | 882 continue; |
765 | 883 f = XFRAME (frame); |
884 if (f->visible) | |
885 value = Fcons (frame, value); | |
286 | 886 } |
887 return value; | |
888 } | |
363 | 889 |
890 | |
891 | |
765 | 892 DEFUN ("redirect-frame-focus", Fredirect_frame_focus, Sredirect_frame_focus, |
363 | 893 1, 2, 0, |
765 | 894 "Arrange for keystrokes typed at FRAME to be sent to FOCUS-FRAME.\n\ |
895 This means that, after reading a keystroke typed at FRAME,\n\ | |
896 `last-event-frame' will be FOCUS-FRAME.\n\ | |
363 | 897 \n\ |
765 | 898 If FOCUS-FRAME is omitted or eq to FRAME, any existing redirection is\n\ |
899 cancelled, and the frame again receives its own keystrokes.\n\ | |
363 | 900 \n\ |
765 | 901 The redirection lasts until the next call to `redirect-frame-focus'\n\ |
902 or `select-frame'.\n\ | |
363 | 903 \n\ |
904 This is useful for temporarily redirecting keystrokes to the minibuffer\n\ | |
765 | 905 window when a frame doesn't have its own minibuffer.") |
906 (frame, focus_frame) | |
907 Lisp_Object frame, focus_frame; | |
363 | 908 { |
765 | 909 CHECK_LIVE_FRAME (frame, 0); |
454 | 910 |
765 | 911 if (NILP (focus_frame)) |
912 focus_frame = frame; | |
363 | 913 else |
765 | 914 CHECK_LIVE_FRAME (focus_frame, 1); |
363 | 915 |
765 | 916 XFRAME (frame)->focus_frame = focus_frame; |
363 | 917 |
765 | 918 if (frame_rehighlight_hook) |
919 (*frame_rehighlight_hook) (); | |
363 | 920 |
921 return Qnil; | |
922 } | |
923 | |
924 | |
765 | 925 DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0, |
926 "Return the frame to which FRAME's keystrokes are currently being sent.\n\ | |
927 See `redirect-frame-focus'.") | |
928 (frame) | |
929 Lisp_Object frame; | |
363 | 930 { |
765 | 931 CHECK_LIVE_FRAME (frame, 0); |
932 return FRAME_FOCUS_FRAME (XFRAME (frame)); | |
363 | 933 } |
934 | |
935 | |
286 | 936 |
937 Lisp_Object | |
765 | 938 get_frame_param (frame, prop) |
939 register struct frame *frame; | |
286 | 940 Lisp_Object prop; |
941 { | |
942 register Lisp_Object tem; | |
943 | |
765 | 944 tem = Fassq (prop, frame->param_alist); |
286 | 945 if (EQ (tem, Qnil)) |
946 return tem; | |
947 return Fcdr (tem); | |
948 } | |
949 | |
950 void | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
951 store_in_alist (alistptr, prop, val) |
286 | 952 Lisp_Object *alistptr, val; |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
953 Lisp_Object prop; |
286 | 954 { |
955 register Lisp_Object tem; | |
956 | |
957 tem = Fassq (prop, *alistptr); | |
958 if (EQ (tem, Qnil)) | |
959 *alistptr = Fcons (Fcons (prop, val), *alistptr); | |
960 else | |
961 Fsetcdr (tem, val); | |
962 } | |
963 | |
964 void | |
765 | 965 store_frame_param (f, prop, val) |
966 struct frame *f; | |
286 | 967 Lisp_Object prop, val; |
968 { | |
969 register Lisp_Object tem; | |
970 | |
765 | 971 tem = Fassq (prop, f->param_alist); |
286 | 972 if (EQ (tem, Qnil)) |
765 | 973 f->param_alist = Fcons (Fcons (prop, val), f->param_alist); |
286 | 974 else |
975 Fsetcdr (tem, val); | |
539 | 976 |
977 if (EQ (prop, Qminibuffer) | |
978 && XTYPE (val) == Lisp_Window) | |
979 { | |
980 if (! MINI_WINDOW_P (XWINDOW (val))) | |
981 error ("Surrogate minibuffer windows must be minibuffer windows."); | |
982 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
983 if (FRAME_HAS_MINIBUF_P (f) || FRAME_MINIBUF_ONLY_P (f)) |
765 | 984 error ("Can't change the surrogate minibuffer of a frame with its own minibuffer."); |
539 | 985 |
986 /* Install the chosen minibuffer window, with proper buffer. */ | |
765 | 987 f->minibuffer_window = val; |
539 | 988 } |
286 | 989 } |
990 | |
765 | 991 DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0, |
992 "Return the parameters-alist of frame FRAME.\n\ | |
286 | 993 It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\ |
777 | 994 The meaningful PARMs depend on the kind of frame.\n\ |
995 If FRAME is omitted, return information on the currently selected frame.") | |
765 | 996 (frame) |
997 Lisp_Object frame; | |
286 | 998 { |
999 Lisp_Object alist; | |
765 | 1000 struct frame *f; |
286 | 1001 |
765 | 1002 if (EQ (frame, Qnil)) |
1003 f = selected_frame; | |
286 | 1004 else |
1005 { | |
765 | 1006 CHECK_FRAME (frame, 0); |
1007 f = XFRAME (frame); | |
286 | 1008 } |
1009 | |
765 | 1010 if (f->display.nothing == 0) |
286 | 1011 return Qnil; |
1012 | |
765 | 1013 alist = Fcopy_alist (f->param_alist); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1014 store_in_alist (&alist, Qname, f->name); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1015 store_in_alist (&alist, Qheight, make_number (f->height)); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1016 store_in_alist (&alist, Qwidth, make_number (f->width)); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1017 store_in_alist (&alist, Qmodeline, (f->wants_modeline ? Qt : Qnil)); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1018 store_in_alist (&alist, Qminibuffer, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1019 (! FRAME_HAS_MINIBUF_P (f) ? Qnone |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1020 : (FRAME_MINIBUF_ONLY_P (f) ? Qonly |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1021 : FRAME_MINIBUF_WINDOW (f)))); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1022 store_in_alist (&alist, Qunsplittable, (f->no_split ? Qt : Qnil)); |
286 | 1023 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1024 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1025 if (FRAME_X_P (f)) |
765 | 1026 x_report_frame_params (f, &alist); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1027 #endif |
286 | 1028 return alist; |
1029 } | |
1030 | |
765 | 1031 DEFUN ("modify-frame-parameters", Fmodify_frame_parameters, |
1032 Smodify_frame_parameters, 2, 2, 0, | |
1033 "Modify the parameters of frame FRAME according to ALIST.\n\ | |
286 | 1034 ALIST is an alist of parameters to change and their new values.\n\ |
1035 Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\ | |
765 | 1036 The meaningful PARMs depend on the kind of frame; undefined PARMs are ignored.") |
1037 (frame, alist) | |
1038 Lisp_Object frame, alist; | |
286 | 1039 { |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1040 FRAME_PTR f; |
286 | 1041 register Lisp_Object tail, elt, prop, val; |
1042 | |
765 | 1043 if (EQ (frame, Qnil)) |
1044 f = selected_frame; | |
286 | 1045 else |
1046 { | |
765 | 1047 CHECK_LIVE_FRAME (frame, 0); |
1048 f = XFRAME (frame); | |
286 | 1049 } |
1050 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1051 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1052 if (FRAME_X_P (f)) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1053 #if 1 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1054 x_set_frame_parameters (f, alist); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1055 #else |
286 | 1056 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail)) |
1057 { | |
1058 elt = Fcar (tail); | |
1059 prop = Fcar (elt); | |
1060 val = Fcdr (elt); | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1061 x_set_frame_param (f, prop, val, get_frame_param (f, prop)); |
765 | 1062 store_frame_param (f, prop, val); |
286 | 1063 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1064 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1065 #endif |
286 | 1066 |
1067 return Qnil; | |
1068 } | |
1069 | |
1070 | |
777 | 1071 #if 0 |
1072 /* This function isn't useful enough by itself to include; we need to | |
1073 add functions to allow the user to find the size of a font before | |
1074 this is actually useful. */ | |
1075 | |
765 | 1076 DEFUN ("frame-pixel-size", Fframe_pixel_size, |
1077 Sframe_pixel_size, 1, 1, 0, | |
1078 "Return a cons (width . height) of FRAME's size in pixels.") | |
1079 (frame) | |
1080 Lisp_Object frame; | |
286 | 1081 { |
765 | 1082 register struct frame *f; |
286 | 1083 int width, height; |
1084 | |
765 | 1085 CHECK_LIVE_FRAME (frame, 0); |
1086 f = XFRAME (frame); | |
286 | 1087 |
765 | 1088 return Fcons (make_number (x_pixel_width (f)), |
1089 make_number (x_pixel_height (f))); | |
286 | 1090 } |
777 | 1091 #endif |
1092 | |
1093 #if 0 | |
1094 /* These functions have no C callers, and can be written nicely in lisp. */ | |
286 | 1095 |
765 | 1096 DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0, |
1097 "Return number of lines available for display on selected frame.") | |
286 | 1098 () |
1099 { | |
765 | 1100 return make_number (FRAME_HEIGHT (selected_frame)); |
286 | 1101 } |
1102 | |
765 | 1103 DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 0, 0, |
1104 "Return number of columns available for display on selected frame.") | |
286 | 1105 () |
1106 { | |
765 | 1107 return make_number (FRAME_WIDTH (selected_frame)); |
286 | 1108 } |
777 | 1109 #endif |
286 | 1110 |
765 | 1111 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0, |
1112 "Specify that the frame FRAME has LINES lines.\n\ | |
286 | 1113 Optional third arg non-nil means that redisplay should use LINES lines\n\ |
765 | 1114 but that the idea of the actual height of the frame should not be changed.") |
1115 (frame, rows, pretend) | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1116 Lisp_Object frame, rows, pretend; |
286 | 1117 { |
765 | 1118 register struct frame *f; |
286 | 1119 |
1120 CHECK_NUMBER (rows, 0); | |
765 | 1121 if (NILP (frame)) |
1122 f = selected_frame; | |
286 | 1123 else |
1124 { | |
765 | 1125 CHECK_LIVE_FRAME (frame, 0); |
1126 f = XFRAME (frame); | |
286 | 1127 } |
1128 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1129 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1130 if (FRAME_X_P (f)) |
286 | 1131 { |
765 | 1132 if (XINT (rows) != f->width) |
1133 x_set_window_size (f, f->width, XINT (rows)); | |
286 | 1134 } |
1135 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1136 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1137 change_frame_size (f, XINT (rows), 0, !NILP (pretend), 0); |
286 | 1138 return Qnil; |
1139 } | |
1140 | |
765 | 1141 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0, |
1142 "Specify that the frame FRAME has COLS columns.\n\ | |
286 | 1143 Optional third arg non-nil means that redisplay should use COLS columns\n\ |
765 | 1144 but that the idea of the actual width of the frame should not be changed.") |
1145 (frame, cols, pretend) | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1146 Lisp_Object frame, cols, pretend; |
286 | 1147 { |
765 | 1148 register struct frame *f; |
286 | 1149 CHECK_NUMBER (cols, 0); |
765 | 1150 if (NILP (frame)) |
1151 f = selected_frame; | |
286 | 1152 else |
1153 { | |
765 | 1154 CHECK_LIVE_FRAME (frame, 0); |
1155 f = XFRAME (frame); | |
286 | 1156 } |
1157 | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1158 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1159 if (FRAME_X_P (f)) |
286 | 1160 { |
765 | 1161 if (XINT (cols) != f->width) |
1162 x_set_window_size (f, XINT (cols), f->height); | |
286 | 1163 } |
1164 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1165 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1166 change_frame_size (f, 0, XINT (cols), !NILP (pretend), 0); |
286 | 1167 return Qnil; |
1168 } | |
1169 | |
765 | 1170 DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0, |
1171 "Sets size of FRAME to COLS by ROWS, measured in characters.") | |
1172 (frame, cols, rows) | |
1173 Lisp_Object frame, cols, rows; | |
286 | 1174 { |
765 | 1175 register struct frame *f; |
286 | 1176 int mask; |
1177 | |
765 | 1178 CHECK_LIVE_FRAME (frame, 0); |
286 | 1179 CHECK_NUMBER (cols, 2); |
1180 CHECK_NUMBER (rows, 1); | |
765 | 1181 f = XFRAME (frame); |
286 | 1182 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1183 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1184 if (FRAME_X_P (f)) |
286 | 1185 { |
765 | 1186 if (XINT (rows) != f->height || XINT (cols) != f->width) |
1187 x_set_window_size (f, XINT (cols), XINT (rows)); | |
286 | 1188 } |
1189 else | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1190 #endif |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1191 change_frame_size (f, XINT (rows), XINT (cols), 0, 0); |
286 | 1192 |
1193 return Qnil; | |
1194 } | |
1195 | |
765 | 1196 DEFUN ("set-frame-position", Fset_frame_position, |
1197 Sset_frame_position, 3, 3, 0, | |
1198 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\ | |
454 | 1199 If XOFFSET or YOFFSET are negative, they are interpreted relative to\n\ |
765 | 1200 the leftmost or bottommost position FRAME could occupy without going\n\ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1201 off the screen.") |
765 | 1202 (frame, xoffset, yoffset) |
1203 Lisp_Object frame, xoffset, yoffset; | |
286 | 1204 { |
765 | 1205 register struct frame *f; |
286 | 1206 int mask; |
1207 | |
765 | 1208 CHECK_LIVE_FRAME (frame, 0); |
286 | 1209 CHECK_NUMBER (xoffset, 1); |
1210 CHECK_NUMBER (yoffset, 2); | |
765 | 1211 f = XFRAME (frame); |
286 | 1212 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1213 #ifdef HAVE_X_WINDOWS |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1214 if (FRAME_X_P (f)) |
765 | 1215 x_set_offset (f, XINT (xoffset), XINT (yoffset)); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1216 #endif |
286 | 1217 |
1218 return Qt; | |
1219 } | |
777 | 1220 |
286 | 1221 |
1222 #ifndef HAVE_X11 | |
1223 DEFUN ("rubber-band-rectangle", Frubber_band_rectangle, Srubber_band_rectangle, | |
1224 3, 3, "", | |
765 | 1225 "Ask user to specify a window position and size on FRAME with the mouse.\n\ |
1226 Arguments are FRAME, NAME and GEO. NAME is a name to be displayed as\n\ | |
286 | 1227 the purpose of this rectangle. GEO is an X-windows size spec that can\n\ |
1228 specify defaults for some sizes/positions. If GEO specifies everything,\n\ | |
1229 the mouse is not used.\n\ | |
765 | 1230 Returns a list of five values: (FRAME LEFT TOP WIDTH HEIGHT).") |
1231 (frame, name, geo) | |
1232 Lisp_Object frame; | |
286 | 1233 Lisp_Object name; |
1234 Lisp_Object geo; | |
1235 { | |
1236 int vals[4]; | |
1237 Lisp_Object nums[4]; | |
1238 int i; | |
1239 | |
765 | 1240 CHECK_FRAME (frame, 0); |
286 | 1241 CHECK_STRING (name, 1); |
1242 CHECK_STRING (geo, 2); | |
1243 | |
765 | 1244 switch (XFRAME (frame)->output_method) |
286 | 1245 { |
1246 case output_x_window: | |
765 | 1247 x_rubber_band (XFRAME (frame), &vals[0], &vals[1], &vals[2], &vals[3], |
286 | 1248 XSTRING (geo)->data, XSTRING (name)->data); |
1249 break; | |
1250 | |
1251 default: | |
1252 return Qnil; | |
1253 } | |
1254 | |
1255 for (i = 0; i < 4; i++) | |
1256 XFASTINT (nums[i]) = vals[i]; | |
765 | 1257 return Fcons (frame, Flist (4, nums)); |
286 | 1258 return Qnil; |
1259 } | |
1260 #endif /* not HAVE_X11 */ | |
1261 | |
765 | 1262 choose_minibuf_frame () |
286 | 1263 { |
765 | 1264 /* For lowest-level minibuf, put it on currently selected frame |
1265 if frame has a minibuffer. */ | |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1266 |
286 | 1267 if (minibuf_level == 0 |
765 | 1268 && selected_frame != 0 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1269 && !EQ (minibuf_window, selected_frame->minibuffer_window)) |
286 | 1270 { |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1271 /* I don't think that any frames may validly have a null minibuffer |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1272 window anymore. */ |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1273 if (NILP (selected_frame->minibuffer_window)) |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1274 abort (); |
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1275 |
765 | 1276 Fset_window_buffer (selected_frame->minibuffer_window, |
286 | 1277 XWINDOW (minibuf_window)->buffer); |
765 | 1278 minibuf_window = selected_frame->minibuffer_window; |
286 | 1279 } |
1280 } | |
1281 | |
765 | 1282 syms_of_frame () |
286 | 1283 { |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1284 /*&&& init symbols here &&&*/ |
765 | 1285 Qframep = intern ("framep"); |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1286 staticpro (&Qframep); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1287 Qlive_frame_p = intern ("live-frame-p"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1288 staticpro (&Qlive_frame_p); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1289 Qheight = intern ("height"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1290 staticpro (&Qheight); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1291 Qicon = intern ("icon"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1292 staticpro (&Qicon); |
539 | 1293 Qminibuffer = intern ("minibuffer"); |
1294 staticpro (&Qminibuffer); | |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1295 Qmodeline = intern ("modeline"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1296 staticpro (&Qmodeline); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1297 Qname = intern ("name"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1298 staticpro (&Qname); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1299 Qnone = intern ("none"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1300 staticpro (&Qnone); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1301 Qonly = intern ("only"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1302 staticpro (&Qonly); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1303 Qunsplittable = intern ("unsplittable"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1304 staticpro (&Qunsplittable); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1305 Qwidth = intern ("width"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1306 staticpro (&Qwidth); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1307 Qx = intern ("x"); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1308 staticpro (&Qx); |
286 | 1309 |
765 | 1310 staticpro (&Vframe_list); |
286 | 1311 |
765 | 1312 DEFVAR_LISP ("terminal-frame", &Vterminal_frame, |
1313 "The initial frame-object, which represents Emacs's stdout."); | |
286 | 1314 |
1315 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified, | |
765 | 1316 "Non-nil if all of emacs is iconified and frame updates are not needed."); |
286 | 1317 Vemacs_iconified = Qnil; |
1318 | |
765 | 1319 DEFVAR_LISP ("default-minibuffer-frame", &Vdefault_minibuffer_frame, |
1320 "Minibufferless frames use this frame's minibuffer.\n\ | |
454 | 1321 \n\ |
765 | 1322 Emacs cannot create minibufferless frames unless this is set to an\n\ |
454 | 1323 appropriate surrogate.\n\ |
1324 \n\ | |
1325 Emacs consults this variable only when creating minibufferless\n\ | |
765 | 1326 frames; once the frame is created, it sticks with its assigned\n\ |
454 | 1327 minibuffer, no matter what this variable is set to. This means that\n\ |
1328 this variable doesn't necessarily say anything meaningful about the\n\ | |
765 | 1329 current set of frames, or where the minibuffer is currently being\n\ |
454 | 1330 displayed."); |
765 | 1331 Vdefault_minibuffer_frame = Qnil; |
286 | 1332 |
765 | 1333 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist, |
1334 "Alist of default values for frame creation.\n\ | |
386 | 1335 These may be set in your init file, like this:\n\ |
765 | 1336 (setq default-frame-alist '((width . 80) (height . 55)))\n\ |
386 | 1337 These override values given in window system configuration data, like\n\ |
1338 X Windows' defaults database.\n\ | |
765 | 1339 For values specific to the first Emacs frame, see `initial-frame-alist'.\n\ |
1340 For values specific to the separate minibuffer frame, see\n\ | |
1341 `minibuffer-frame-alist'."); | |
1342 Vdefault_frame_alist = Qnil; | |
386 | 1343 |
765 | 1344 defsubr (&Sframep); |
1345 defsubr (&Slive_frame_p); | |
1346 defsubr (&Sselect_frame); | |
1347 defsubr (&Sselected_frame); | |
1348 defsubr (&Swindow_frame); | |
1349 defsubr (&Sframe_root_window); | |
1350 defsubr (&Sframe_selected_window); | |
1351 defsubr (&Sframe_list); | |
1352 defsubr (&Snext_frame); | |
1353 defsubr (&Sdelete_frame); | |
454 | 1354 defsubr (&Smouse_position); |
286 | 1355 defsubr (&Sset_mouse_position); |
1356 #if 0 | |
765 | 1357 defsubr (&Sframe_configuration); |
1358 defsubr (&Srestore_frame_configuration); | |
286 | 1359 #endif |
765 | 1360 defsubr (&Smake_frame_visible); |
1361 defsubr (&Smake_frame_invisible); | |
1362 defsubr (&Siconify_frame); | |
1363 defsubr (&Sframe_visible_p); | |
1364 defsubr (&Svisible_frame_list); | |
1365 defsubr (&Sredirect_frame_focus); | |
1366 defsubr (&Sframe_focus); | |
1367 defsubr (&Sframe_parameters); | |
1368 defsubr (&Smodify_frame_parameters); | |
785 | 1369 #if 0 |
765 | 1370 defsubr (&Sframe_pixel_size); |
1371 defsubr (&Sframe_height); | |
1372 defsubr (&Sframe_width); | |
785 | 1373 #endif |
765 | 1374 defsubr (&Sset_frame_height); |
1375 defsubr (&Sset_frame_width); | |
1376 defsubr (&Sset_frame_size); | |
1377 defsubr (&Sset_frame_position); | |
286 | 1378 #ifndef HAVE_X11 |
1379 defsubr (&Srubber_band_rectangle); | |
1380 #endif /* HAVE_X11 */ | |
1381 } | |
732 | 1382 |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1383 keys_of_frame () |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1384 { |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1385 initial_define_lispy_key (global_map, "switch-frame", "select-frame"); |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1386 } |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1387 |
1118
a43d53261506
* frame.c (choose_minibuf_frame): abort if the selected frame has
Jim Blandy <jimb@redhat.com>
parents:
1006
diff
changeset
|
1388 #else /* not MULTI_FRAME */ |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1389 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1390 /* If we're not using multi-frame stuff, we still need to provide some |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1391 support functions. */ |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1392 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1393 /* Unless this function is defined, providing set-frame-height and |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1394 set-frame-width doesn't help compatibility any, since they both |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1395 want this as their first argument. */ |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1396 DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0, |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1397 "Return the frame that is now selected.") |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1398 () |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1399 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1400 Lisp_Object tem; |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1401 XFASTINT (tem) = 0; |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1402 return tem; |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1403 } |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1404 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1405 DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1406 "Specify that the frame FRAME has LINES lines.\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1407 Optional third arg non-nil means that redisplay should use LINES lines\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1408 but that the idea of the actual height of the frame should not be changed.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1409 (frame, rows, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1410 Lisp_Object frame, rows, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1411 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1412 CHECK_NUMBER (rows, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1413 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1414 change_frame_size (0, XINT (rows), 0, !NILP (pretend), 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1415 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1416 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1417 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1418 DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1419 "Specify that the frame FRAME has COLS columns.\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1420 Optional third arg non-nil means that redisplay should use COLS columns\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1421 but that the idea of the actual width of the frame should not be changed.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1422 (frame, cols, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1423 Lisp_Object frame, cols, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1424 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1425 CHECK_NUMBER (cols, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1426 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1427 change_frame_size (0, 0, XINT (cols), !NILP (pretend), 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1428 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1429 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1430 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1431 DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1432 "Sets size of FRAME to COLS by ROWS, measured in characters.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1433 (frame, cols, rows) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1434 Lisp_Object frame, cols, rows; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1435 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1436 CHECK_NUMBER (cols, 2); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1437 CHECK_NUMBER (rows, 1); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1438 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1439 change_frame_size (0, XINT (rows), XINT (cols), 0, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1440 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1441 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1442 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1443 |
987
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1444 DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0, |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1445 "Return number of lines available for display on selected frame.") |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1446 () |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1447 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1448 return make_number (FRAME_HEIGHT (selected_frame)); |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1449 } |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1450 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1451 DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 0, 0, |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1452 "Return number of columns available for display on selected frame.") |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1453 () |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1454 { |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1455 return make_number (FRAME_WIDTH (selected_frame)); |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1456 } |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1457 |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1458 /* These are for backward compatibility with Emacs 18. */ |
afb21e974ed2
* frame.c (make_frame): Stop passing zero to make_window; it's not
Jim Blandy <jimb@redhat.com>
parents:
965
diff
changeset
|
1459 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1460 DEFUN ("set-screen-height", Fset_screen_height, Sset_screen_height, 1, 2, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1461 "Tell redisplay that the screen has LINES lines.\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1462 Optional second arg non-nil means that redisplay should use LINES lines\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1463 but that the idea of the actual height of the screen should not be changed.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1464 (lines, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1465 Lisp_Object lines, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1466 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1467 CHECK_NUMBER (lines, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1468 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1469 change_frame_size (0, XINT (lines), 0, !NILP (pretend), 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1470 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1471 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1472 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1473 DEFUN ("set-screen-width", Fset_screen_width, Sset_screen_width, 1, 2, 0, |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1474 "Tell redisplay that the screen has COLS columns.\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1475 Optional second arg non-nil means that redisplay should use COLS columns\n\ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1476 but that the idea of the actual width of the screen should not be changed.") |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1477 (cols, pretend) |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1478 Lisp_Object cols, pretend; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1479 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1480 CHECK_NUMBER (cols, 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1481 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1482 change_frame_size (0, 0, XINT (cols), !NILP (pretend), 0); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1483 return Qnil; |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1484 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1485 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1486 syms_of_frame () |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1487 { |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1488 defsubr (&Sset_frame_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1489 defsubr (&Sset_frame_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1490 defsubr (&Sset_frame_size); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1491 defsubr (&Sset_screen_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1492 defsubr (&Sset_screen_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1493 defsubr (&Sframe_height); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1494 Ffset (intern ("screen-height"), intern ("frame-height")); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1495 defsubr (&Sframe_width); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1496 Ffset (intern ("screen-width"), intern ("frame-width")); |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1497 } |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1498 |
1385
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1499 keys_of_frame () |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1500 { |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1501 } |
a4a205bdd2c1
* frame.c: #include "commands.h" and "keyboard.h".
Jim Blandy <jimb@redhat.com>
parents:
1346
diff
changeset
|
1502 |
965
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1503 #endif /* not MULTI_FRAME */ |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1504 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1505 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1506 |
0eb68c6c452a
* frame.c (Qheight, Qicon, Qmodeline, Qname, Qnone, Qonly,
Jim Blandy <jimb@redhat.com>
parents:
886
diff
changeset
|
1507 |