aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1992-07-13 20:53:59 +0000
committerJim Blandy1992-07-13 20:53:59 +0000
commitff11dfa15b3b56559bac0d5c6b0a26a80d2d5f6d (patch)
tree1d3957068bbd0a226e1bf934d04b099b2c0d15b8 /src
parent502b9b6441d9c3ce0fdc5f671447f30f11fb5afb (diff)
downloademacs-ff11dfa15b3b56559bac0d5c6b0a26a80d2d5f6d.tar.gz
emacs-ff11dfa15b3b56559bac0d5c6b0a26a80d2d5f6d.zip
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/frame.c1084
-rw-r--r--src/frame.h354
-rw-r--r--src/keyboard.c142
-rw-r--r--src/lisp.h60
-rw-r--r--src/minibuf.c42
-rw-r--r--src/process.c12
-rw-r--r--src/term.c246
7 files changed, 970 insertions, 970 deletions
diff --git a/src/frame.c b/src/frame.c
index 1068c2e2e01..8482d1b3d14 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1,4 +1,4 @@
1/* Generic screen functions. 1/* Generic frame functions.
2 Copyright (C) 1989, 1992 Free Software Foundation. 2 Copyright (C) 1989, 1992 Free Software Foundation.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
@@ -21,36 +21,36 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
21 21
22#include "config.h" 22#include "config.h"
23 23
24#ifdef MULTI_SCREEN 24#ifdef MULTI_FRAME
25 25
26#include "lisp.h" 26#include "lisp.h"
27#include "screen.h" 27#include "frame.h"
28#include "window.h" 28#include "window.h"
29#include "termhooks.h" 29#include "termhooks.h"
30 30
31Lisp_Object Vemacs_iconified; 31Lisp_Object Vemacs_iconified;
32Lisp_Object Qscreenp; 32Lisp_Object Qframep;
33Lisp_Object Qlive_screen_p; 33Lisp_Object Qlive_frame_p;
34Lisp_Object Vscreen_list; 34Lisp_Object Vframe_list;
35Lisp_Object Vterminal_screen; 35Lisp_Object Vterminal_frame;
36Lisp_Object Vdefault_minibuffer_screen; 36Lisp_Object Vdefault_minibuffer_frame;
37Lisp_Object Vdefault_screen_alist; 37Lisp_Object Vdefault_frame_alist;
38Lisp_Object Qminibuffer; 38Lisp_Object Qminibuffer;
39 39
40extern Lisp_Object Vminibuffer_list; 40extern Lisp_Object Vminibuffer_list;
41extern Lisp_Object get_minibuffer (); 41extern Lisp_Object get_minibuffer ();
42 42
43DEFUN ("screenp", Fscreenp, Sscreenp, 1, 1, 0, 43DEFUN ("framep", Fframep, Sframep, 1, 1, 0,
44 "Return non-nil if OBJECT is a screen.\n\ 44 "Return non-nil if OBJECT is a frame.\n\
45Value is t for a termcap screen (a character-only terminal),\n\ 45Value is t for a termcap frame (a character-only terminal),\n\
46`x' for an Emacs screen that is really an X window.\n\ 46`x' for an Emacs frame that is really an X window.\n\
47Also see `live-screen-p'.") 47Also see `live-frame-p'.")
48 (object) 48 (object)
49 Lisp_Object object; 49 Lisp_Object object;
50{ 50{
51 if (XTYPE (object) != Lisp_Screen) 51 if (XTYPE (object) != Lisp_Frame)
52 return Qnil; 52 return Qnil;
53 switch (XSCREEN (object)->output_method) 53 switch (XFRAME (object)->output_method)
54 { 54 {
55 case output_termcap: 55 case output_termcap:
56 return Qt; 56 return Qt;
@@ -61,53 +61,53 @@ Also see `live-screen-p'.")
61 } 61 }
62} 62}
63 63
64DEFUN ("live-screen-p", Flive_screen_p, Slive_screen_p, 1, 1, 0, 64DEFUN ("live-frame-p", Flive_frame_p, Slive_frame_p, 1, 1, 0,
65 "Return non-nil if OBJECT is a screen which has not been deleted.\n\ 65 "Return non-nil if OBJECT is a frame which has not been deleted.\n\
66Value is nil if OBJECT is not a live screen. If object is a live\n\ 66Value is nil if OBJECT is not a live frame. If object is a live\n\
67screen, the return value indicates what sort of output device it is\n\ 67frame, the return value indicates what sort of output device it is\n\
68displayed on. Value is t for a termcap screen (a character-only\n\ 68displayed on. Value is t for a termcap frame (a character-only\n\
69terminal), `x' for an Emacs screen being displayed in an X window.") 69terminal), `x' for an Emacs frame being displayed in an X window.")
70 (object) 70 (object)
71 Lisp_Object object; 71 Lisp_Object object;
72{ 72{
73 return ((SCREENP (object) 73 return ((FRAMEP (object)
74 && SCREEN_LIVE_P (XSCREEN (object))) 74 && FRAME_LIVE_P (XFRAME (object)))
75 ? Fscreenp (object) 75 ? Fframep (object)
76 : Qnil); 76 : Qnil);
77} 77}
78 78
79struct screen * 79struct frame *
80make_screen (mini_p) 80make_frame (mini_p)
81 int mini_p; 81 int mini_p;
82{ 82{
83 Lisp_Object screen; 83 Lisp_Object frame;
84 register struct screen *s; 84 register struct frame *f;
85 register Lisp_Object root_window; 85 register Lisp_Object root_window;
86 register Lisp_Object mini_window; 86 register Lisp_Object mini_window;
87 87
88 screen = Fmake_vector (((sizeof (struct screen) - (sizeof (Lisp_Vector) 88 frame = Fmake_vector (((sizeof (struct frame) - (sizeof (Lisp_Vector)
89 - sizeof (Lisp_Object))) 89 - sizeof (Lisp_Object)))
90 / sizeof (Lisp_Object)), 90 / sizeof (Lisp_Object)),
91 make_number (0)); 91 make_number (0));
92 XSETTYPE (screen, Lisp_Screen); 92 XSETTYPE (frame, Lisp_Frame);
93 s = XSCREEN (screen); 93 f = XFRAME (frame);
94 94
95 s->cursor_x = 0; 95 f->cursor_x = 0;
96 s->cursor_y = 0; 96 f->cursor_y = 0;
97 s->current_glyphs = 0; 97 f->current_glyphs = 0;
98 s->desired_glyphs = 0; 98 f->desired_glyphs = 0;
99 s->visible = 0; 99 f->visible = 0;
100 s->display.nothing = 0; 100 f->display.nothing = 0;
101 s->iconified = 0; 101 f->iconified = 0;
102 s->wants_modeline = 1; 102 f->wants_modeline = 1;
103 s->auto_raise = 0; 103 f->auto_raise = 0;
104 s->auto_lower = 0; 104 f->auto_lower = 0;
105 s->no_split = 0; 105 f->no_split = 0;
106 s->garbaged = 0; 106 f->garbaged = 0;
107 s->has_minibuffer = mini_p; 107 f->has_minibuffer = mini_p;
108 s->focus_screen = screen; 108 f->focus_frame = frame;
109 109
110 s->param_alist = Qnil; 110 f->param_alist = Qnil;
111 111
112 root_window = make_window (0); 112 root_window = make_window (0);
113 if (mini_p) 113 if (mini_p)
@@ -116,24 +116,24 @@ make_screen (mini_p)
116 XWINDOW (root_window)->next = mini_window; 116 XWINDOW (root_window)->next = mini_window;
117 XWINDOW (mini_window)->prev = root_window; 117 XWINDOW (mini_window)->prev = root_window;
118 XWINDOW (mini_window)->mini_p = Qt; 118 XWINDOW (mini_window)->mini_p = Qt;
119 XWINDOW (mini_window)->screen = screen; 119 XWINDOW (mini_window)->frame = frame;
120 s->minibuffer_window = mini_window; 120 f->minibuffer_window = mini_window;
121 } 121 }
122 else 122 else
123 { 123 {
124 mini_window = Qnil; 124 mini_window = Qnil;
125 XWINDOW (root_window)->next = Qnil; 125 XWINDOW (root_window)->next = Qnil;
126 s->minibuffer_window = Qnil; 126 f->minibuffer_window = Qnil;
127 } 127 }
128 128
129 XWINDOW (root_window)->screen = screen; 129 XWINDOW (root_window)->frame = frame;
130 130
131 /* 10 is arbitrary, 131 /* 10 is arbitrary,
132 just so that there is "something there." 132 just so that there is "something there."
133 Correct size will be set up later with change_screen_size. */ 133 Correct size will be set up later with change_frame_size. */
134 134
135 s->width = 10; 135 f->width = 10;
136 s->height = 10; 136 f->height = 10;
137 137
138 XFASTINT (XWINDOW (root_window)->width) = 10; 138 XFASTINT (XWINDOW (root_window)->width) = 10;
139 XFASTINT (XWINDOW (root_window)->height) = (mini_p ? 9 : 10); 139 XFASTINT (XWINDOW (root_window)->height) = (mini_p ? 9 : 10);
@@ -145,7 +145,7 @@ make_screen (mini_p)
145 XFASTINT (XWINDOW (mini_window)->height) = 1; 145 XFASTINT (XWINDOW (mini_window)->height) = 1;
146 } 146 }
147 147
148 /* Choose a buffer for the screen's root window. */ 148 /* Choose a buffer for the frame's root window. */
149 { 149 {
150 Lisp_Object buf; 150 Lisp_Object buf;
151 151
@@ -167,82 +167,82 @@ make_screen (mini_p)
167 : Fcar (Vminibuffer_list))); 167 : Fcar (Vminibuffer_list)));
168 } 168 }
169 169
170 s->root_window = root_window; 170 f->root_window = root_window;
171 s->selected_window = root_window; 171 f->selected_window = root_window;
172 /* Make sure this window seems more recently used than 172 /* Make sure this window seems more recently used than
173 a newly-created, never-selected window. */ 173 a newly-created, never-selected window. */
174 XFASTINT (XWINDOW (s->selected_window)->use_time) = ++window_select_count; 174 XFASTINT (XWINDOW (f->selected_window)->use_time) = ++window_select_count;
175 175
176 Vscreen_list = Fcons (screen, Vscreen_list); 176 Vframe_list = Fcons (frame, Vframe_list);
177 177
178 return s; 178 return f;
179} 179}
180 180
181/* Make a screen using a separate minibuffer window on another screen. 181/* Make a frame using a separate minibuffer window on another frame.
182 MINI_WINDOW is the minibuffer window to use. nil means use the 182 MINI_WINDOW is the minibuffer window to use. nil means use the
183 default (the global minibuffer). */ 183 default (the global minibuffer). */
184 184
185struct screen * 185struct frame *
186make_screen_without_minibuffer (mini_window) 186make_frame_without_minibuffer (mini_window)
187 register Lisp_Object mini_window; 187 register Lisp_Object mini_window;
188{ 188{
189 register struct screen *s; 189 register struct frame *f;
190 190
191 /* Choose the minibuffer window to use. */ 191 /* Choose the minibuffer window to use. */
192 if (NILP (mini_window)) 192 if (NILP (mini_window))
193 { 193 {
194 if (XTYPE (Vdefault_minibuffer_screen) != Lisp_Screen) 194 if (XTYPE (Vdefault_minibuffer_frame) != Lisp_Frame)
195 error ("default-minibuffer-screen must be set when creating minibufferless screens"); 195 error ("default-minibuffer-frame must be set when creating minibufferless frames");
196 if (! SCREEN_LIVE_P (XSCREEN (Vdefault_minibuffer_screen))) 196 if (! FRAME_LIVE_P (XFRAME (Vdefault_minibuffer_frame)))
197 error ("default-minibuffer-screen must be a live screen"); 197 error ("default-minibuffer-frame must be a live frame");
198 mini_window = XSCREEN (Vdefault_minibuffer_screen)->minibuffer_window; 198 mini_window = XFRAME (Vdefault_minibuffer_frame)->minibuffer_window;
199 } 199 }
200 else 200 else
201 { 201 {
202 CHECK_WINDOW (mini_window, 0); 202 CHECK_WINDOW (mini_window, 0);
203 } 203 }
204 204
205 /* Make a screen containing just a root window. */ 205 /* Make a frame containing just a root window. */
206 s = make_screen (0); 206 f = make_frame (0);
207 207
208 /* Install the chosen minibuffer window, with proper buffer. */ 208 /* Install the chosen minibuffer window, with proper buffer. */
209 s->minibuffer_window = mini_window; 209 f->minibuffer_window = mini_window;
210 Fset_window_buffer (mini_window, 210 Fset_window_buffer (mini_window,
211 (NILP (Vminibuffer_list) 211 (NILP (Vminibuffer_list)
212 ? get_minibuffer (0) 212 ? get_minibuffer (0)
213 : Fcar (Vminibuffer_list))); 213 : Fcar (Vminibuffer_list)));
214 return s; 214 return f;
215} 215}
216 216
217/* Make a screen containing only a minibuffer window. */ 217/* Make a frame containing only a minibuffer window. */
218 218
219struct screen * 219struct frame *
220make_minibuffer_screen () 220make_minibuffer_frame ()
221{ 221{
222 /* First make a screen containing just a root window, no minibuffer. */ 222 /* First make a frame containing just a root window, no minibuffer. */
223 223
224 register struct screen *s = make_screen (0); 224 register struct frame *f = make_frame (0);
225 register Lisp_Object mini_window; 225 register Lisp_Object mini_window;
226 register Lisp_Object screen; 226 register Lisp_Object frame;
227 227
228 XSET (screen, Lisp_Screen, s); 228 XSET (frame, Lisp_Frame, f);
229 229
230 /* ??? Perhaps leave it to the user program to set auto_raise. */ 230 /* ??? Perhaps leave it to the user program to set auto_raise. */
231 s->auto_raise = 1; 231 f->auto_raise = 1;
232 s->auto_lower = 0; 232 f->auto_lower = 0;
233 s->no_split = 1; 233 f->no_split = 1;
234 s->wants_modeline = 0; 234 f->wants_modeline = 0;
235 s->has_minibuffer = 1; 235 f->has_minibuffer = 1;
236 236
237 /* Now label the root window as also being the minibuffer. 237 /* Now label the root window as also being the minibuffer.
238 Avoid infinite looping on the window chain by marking next pointer 238 Avoid infinite looping on the window chain by marking next pointer
239 as nil. */ 239 as nil. */
240 240
241 mini_window = s->minibuffer_window = s->root_window; 241 mini_window = f->minibuffer_window = f->root_window;
242 XWINDOW (mini_window)->mini_p = Qt; 242 XWINDOW (mini_window)->mini_p = Qt;
243 XWINDOW (mini_window)->next = Qnil; 243 XWINDOW (mini_window)->next = Qnil;
244 XWINDOW (mini_window)->prev = mini_window; 244 XWINDOW (mini_window)->prev = mini_window;
245 XWINDOW (mini_window)->screen = screen; 245 XWINDOW (mini_window)->frame = frame;
246 246
247 /* Put the proper buffer in that window. */ 247 /* Put the proper buffer in that window. */
248 248
@@ -250,347 +250,347 @@ make_minibuffer_screen ()
250 (NILP (Vminibuffer_list) 250 (NILP (Vminibuffer_list)
251 ? get_minibuffer (0) 251 ? get_minibuffer (0)
252 : Fcar (Vminibuffer_list))); 252 : Fcar (Vminibuffer_list)));
253 return s; 253 return f;
254} 254}
255 255
256/* Construct a screen that refers to the terminal (stdin and stdout). */ 256/* Construct a frame that refers to the terminal (stdin and stdout). */
257 257
258struct screen * 258struct frame *
259make_terminal_screen () 259make_terminal_frame ()
260{ 260{
261 register struct screen *s; 261 register struct frame *f;
262 262
263 Vscreen_list = Qnil; 263 Vframe_list = Qnil;
264 s = make_screen (1); 264 f = make_frame (1);
265 s->name = build_string ("terminal"); 265 f->name = build_string ("terminal");
266 s->visible = 1; 266 f->visible = 1;
267 s->display.nothing = 1; /* Nonzero means screen isn't deleted. */ 267 f->display.nothing = 1; /* Nonzero means frame isn't deleted. */
268 XSET (Vterminal_screen, Lisp_Screen, s); 268 XSET (Vterminal_frame, Lisp_Frame, f);
269 return s; 269 return f;
270} 270}
271 271
272DEFUN ("select-screen", Fselect_screen, Sselect_screen, 1, 2, 0, 272DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, 0,
273 "Select the screen S. S's selected window becomes \"the\"\n\ 273 "Select the frame FRAME. FRAMES's selected window becomes \"the\"\n\
274selected window. If the optional parameter NO-ENTER is non-nil, don't\n\ 274selected window. If the optional parameter NO-ENTER is non-nil, don't\n\
275focus on that screen.") 275focus on that frame.")
276 (screen, no_enter) 276 (frame, no_enter)
277 Lisp_Object screen, no_enter; 277 Lisp_Object frame, no_enter;
278{ 278{
279 CHECK_LIVE_SCREEN (screen, 0); 279 CHECK_LIVE_FRAME (frame, 0);
280 280
281 if (selected_screen == XSCREEN (screen)) 281 if (selected_frame == XFRAME (frame))
282 return screen; 282 return frame;
283 283
284 selected_screen = XSCREEN (screen); 284 selected_frame = XFRAME (frame);
285 if (! SCREEN_MINIBUF_ONLY_P (selected_screen)) 285 if (! FRAME_MINIBUF_ONLY_P (selected_frame))
286 last_nonminibuf_screen = selected_screen; 286 last_nonminibuf_frame = selected_frame;
287 287
288 Fselect_window (XSCREEN (screen)->selected_window); 288 Fselect_window (XFRAME (frame)->selected_window);
289 289
290#ifdef HAVE_X_WINDOWS 290#ifdef HAVE_X_WINDOWS
291#ifdef MULTI_SCREEN 291#ifdef MULTI_FRAME
292 if (SCREEN_IS_X (XSCREEN (screen)) 292 if (FRAME_IS_X (XFRAME (frame))
293 && NILP (no_enter)) 293 && NILP (no_enter))
294 { 294 {
295 Ffocus_screen (screen); 295 Ffocus_frame (frame);
296 } 296 }
297#endif 297#endif
298#endif 298#endif
299 choose_minibuf_screen (); 299 choose_minibuf_frame ();
300 300
301 return screen; 301 return frame;
302} 302}
303 303
304DEFUN ("selected-screen", Fselected_screen, Sselected_screen, 0, 0, 0, 304DEFUN ("selected-frame", Fselected_frame, Sselected_frame, 0, 0, 0,
305 "Return the screen that is now selected.") 305 "Return the frame that is now selected.")
306 () 306 ()
307{ 307{
308 Lisp_Object tem; 308 Lisp_Object tem;
309 XSET (tem, Lisp_Screen, selected_screen); 309 XSET (tem, Lisp_Frame, selected_frame);
310 return tem; 310 return tem;
311} 311}
312 312
313DEFUN ("window-screen", Fwindow_screen, Swindow_screen, 1, 1, 0, 313DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 1, 1, 0,
314 "Return the screen object that window WINDOW is on.") 314 "Return the frame object that window WINDOW is on.")
315 (window) 315 (window)
316 Lisp_Object window; 316 Lisp_Object window;
317{ 317{
318 CHECK_WINDOW (window, 0); 318 CHECK_WINDOW (window, 0);
319 return XWINDOW (window)->screen; 319 return XWINDOW (window)->frame;
320} 320}
321 321
322DEFUN ("screen-root-window", Fscreen_root_window, Sscreen_root_window, 0, 1, 0, 322DEFUN ("frame-root-window", Fframe_root_window, Sframe_root_window, 0, 1, 0,
323 "Returns the root-window of SCREEN.") 323 "Returns the root-window of FRAME.")
324 (screen) 324 (frame)
325 Lisp_Object screen; 325 Lisp_Object frame;
326{ 326{
327 if (NILP (screen)) 327 if (NILP (frame))
328 XSET (screen, Lisp_Screen, selected_screen); 328 XSET (frame, Lisp_Frame, selected_frame);
329 else 329 else
330 CHECK_LIVE_SCREEN (screen, 0); 330 CHECK_LIVE_FRAME (frame, 0);
331 331
332 return XSCREEN (screen)->root_window; 332 return XFRAME (frame)->root_window;
333} 333}
334 334
335DEFUN ("screen-selected-window", Fscreen_selected_window, 335DEFUN ("frame-selected-window", Fframe_selected_window,
336 Sscreen_selected_window, 0, 1, 0, 336 Sframe_selected_window, 0, 1, 0,
337 "Return the selected window of screen object SCREEN.") 337 "Return the selected window of frame object FRAME.")
338 (screen) 338 (frame)
339 Lisp_Object screen; 339 Lisp_Object frame;
340{ 340{
341 if (NILP (screen)) 341 if (NILP (frame))
342 XSET (screen, Lisp_Screen, selected_screen); 342 XSET (frame, Lisp_Frame, selected_frame);
343 else 343 else
344 CHECK_LIVE_SCREEN (screen, 0); 344 CHECK_LIVE_FRAME (frame, 0);
345 345
346 return XSCREEN (screen)->selected_window; 346 return XFRAME (frame)->selected_window;
347} 347}
348 348
349DEFUN ("screen-list", Fscreen_list, Sscreen_list, 349DEFUN ("frame-list", Fframe_list, Sframe_list,
350 0, 0, 0, 350 0, 0, 0,
351 "Return a list of all screens.") 351 "Return a list of all frames.")
352 () 352 ()
353{ 353{
354 return Fcopy_sequence (Vscreen_list); 354 return Fcopy_sequence (Vframe_list);
355} 355}
356 356
357#ifdef MULTI_SCREEN 357#ifdef MULTI_FRAME
358 358
359/* Return the next screen in the screen list after SCREEN. 359/* Return the next frame in the frame list after FRAME.
360 If MINIBUF is non-nil, include all screens. 360 If MINIBUF is non-nil, include all frames.
361 If MINIBUF is nil, exclude minibuffer-only screens. 361 If MINIBUF is nil, exclude minibuffer-only frames.
362 If MINIBUF is a window, include only screens using that window for 362 If MINIBUF is a window, include only frames using that window for
363 their minibuffer. */ 363 their minibuffer. */
364Lisp_Object 364Lisp_Object
365next_screen (screen, minibuf) 365next_frame (frame, minibuf)
366 Lisp_Object screen; 366 Lisp_Object frame;
367 Lisp_Object minibuf; 367 Lisp_Object minibuf;
368{ 368{
369 Lisp_Object tail; 369 Lisp_Object tail;
370 int passed = 0; 370 int passed = 0;
371 371
372 /* There must always be at least one screen in Vscreen_list. */ 372 /* There must always be at least one frame in Vframe_list. */
373 if (! CONSP (Vscreen_list)) 373 if (! CONSP (Vframe_list))
374 abort (); 374 abort ();
375 375
376 while (1) 376 while (1)
377 for (tail = Vscreen_list; CONSP (tail); tail = XCONS (tail)->cdr) 377 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
378 { 378 {
379 if (passed) 379 if (passed)
380 { 380 {
381 Lisp_Object s = XCONS (tail)->car; 381 Lisp_Object f = XCONS (tail)->car;
382 382
383 /* Decide whether this screen is eligible to be returned, 383 /* Decide whether this frame is eligible to be returned,
384 according to minibuf. */ 384 according to minibuf. */
385 if ((NILP (minibuf) && ! SCREEN_MINIBUF_ONLY_P (XSCREEN (s))) 385 if ((NILP (minibuf) && ! FRAME_MINIBUF_ONLY_P (XFRAME (f)))
386 || XTYPE (minibuf) != Lisp_Window 386 || XTYPE (minibuf) != Lisp_Window
387 || EQ (SCREEN_MINIBUF_WINDOW (XSCREEN (s)), minibuf) 387 || EQ (FRAME_MINIBUF_WINDOW (XFRAME (f)), minibuf)
388 || EQ (s, screen)) 388 || EQ (f, frame))
389 return s; 389 return f;
390 } 390 }
391 391
392 if (EQ (screen, XCONS (tail)->car)) 392 if (EQ (frame, XCONS (tail)->car))
393 passed++; 393 passed++;
394 } 394 }
395} 395}
396 396
397/* Return the previous screen in the screen list before SCREEN. 397/* Return the previous frame in the frame list before FRAME.
398 If MINIBUF is non-nil, include all screens. 398 If MINIBUF is non-nil, include all frames.
399 If MINIBUF is nil, exclude minibuffer-only screens. 399 If MINIBUF is nil, exclude minibuffer-only frames.
400 If MINIBUF is a window, include only screens using that window for 400 If MINIBUF is a window, include only frames using that window for
401 their minibuffer. */ 401 their minibuffer. */
402Lisp_Object 402Lisp_Object
403prev_screen (screen, minibuf) 403prev_frame (frame, minibuf)
404 Lisp_Object screen; 404 Lisp_Object frame;
405 Lisp_Object minibuf; 405 Lisp_Object minibuf;
406{ 406{
407 Lisp_Object tail; 407 Lisp_Object tail;
408 Lisp_Object prev; 408 Lisp_Object prev;
409 409
410 /* There must always be at least one screen in Vscreen_list. */ 410 /* There must always be at least one frame in Vframe_list. */
411 if (! CONSP (Vscreen_list)) 411 if (! CONSP (Vframe_list))
412 abort (); 412 abort ();
413 413
414 prev = Qnil; 414 prev = Qnil;
415 while (1) 415 while (1)
416 { 416 {
417 for (tail = Vscreen_list; CONSP (tail); tail = XCONS (tail)->cdr) 417 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
418 { 418 {
419 Lisp_Object scr = XCONS (tail)->car; 419 Lisp_Object scr = XCONS (tail)->car;
420 420
421 if (XTYPE (scr) != Lisp_Screen) 421 if (XTYPE (scr) != Lisp_Frame)
422 abort (); 422 abort ();
423 423
424 if (EQ (screen, scr) && !NILP (prev)) 424 if (EQ (frame, scr) && !NILP (prev))
425 return prev; 425 return prev;
426 426
427 /* Decide whether this screen is eligible to be returned, 427 /* Decide whether this frame is eligible to be returned,
428 according to minibuf. */ 428 according to minibuf. */
429 if ((NILP (minibuf) && ! SCREEN_MINIBUF_ONLY_P (XSCREEN (scr))) 429 if ((NILP (minibuf) && ! FRAME_MINIBUF_ONLY_P (XFRAME (scr)))
430 || XTYPE (minibuf) != Lisp_Window 430 || XTYPE (minibuf) != Lisp_Window
431 || EQ (SCREEN_MINIBUF_WINDOW (XSCREEN (scr)), minibuf)) 431 || EQ (FRAME_MINIBUF_WINDOW (XFRAME (scr)), minibuf))
432 prev = scr; 432 prev = scr;
433 } 433 }
434 434
435 if (NILP (prev)) 435 if (NILP (prev))
436 /* We went through the whole screen list without finding a single 436 /* We went through the whole frame list without finding a single
437 acceptable screen. Return the original screen. */ 437 acceptable frame. Return the original frame. */
438 prev = screen; 438 prev = frame;
439 } 439 }
440 440
441} 441}
442 442
443DEFUN ("next-screen", Fnext_screen, Snext_screen, 0, 2, 0, 443DEFUN ("next-frame", Fnext_frame, Snext_frame, 0, 2, 0,
444 "Return the next screen in the screen list after SCREEN.\n\ 444 "Return the next frame in the frame list after FRAME.\n\
445If optional argument MINIBUF is non-nil, include all screens. If\n\ 445If optional argument MINIBUF is non-nil, include all frames. If\n\
446MINIBUF is nil or omitted, exclude minibuffer-only screens. If\n\ 446MINIBUF is nil or omitted, exclude minibuffer-only frames. If\n\
447MINIBUF is a window, include only screens using that window for their\n\ 447MINIBUF is a window, include only frames using that window for their\n\
448minibuffer.") 448minibuffer.")
449 (screen, miniscreen) 449 (frame, miniframe)
450Lisp_Object screen, miniscreen; 450Lisp_Object frame, miniframe;
451{ 451{
452 Lisp_Object tail; 452 Lisp_Object tail;
453 453
454 if (NILP (screen)) 454 if (NILP (frame))
455 XSET (screen, Lisp_Screen, selected_screen); 455 XSET (frame, Lisp_Frame, selected_frame);
456 else 456 else
457 CHECK_LIVE_SCREEN (screen, 0); 457 CHECK_LIVE_FRAME (frame, 0);
458 458
459 return next_screen (screen, miniscreen); 459 return next_frame (frame, miniframe);
460} 460}
461#endif /* MULTI_SCREEN */ 461#endif /* MULTI_FRAME */
462 462
463DEFUN ("delete-screen", Fdelete_screen, Sdelete_screen, 0, 1, "", 463DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 1, "",
464 "Delete SCREEN, permanently eliminating it from use.\n\ 464 "Delete FRAME, permanently eliminating it from use.\n\
465If omitted, SCREEN defaults to the selected screen.\n\ 465If omitted, FRAME defaults to the selected frame.\n\
466A screen may not be deleted if its minibuffer is used by other screens.") 466A frame may not be deleted if its minibuffer is used by other frames.")
467 (screen) 467 (frame)
468 Lisp_Object screen; 468 Lisp_Object frame;
469{ 469{
470 struct screen *s; 470 struct frame *f;
471 union display displ; 471 union display displ;
472 472
473 if (EQ (screen, Qnil)) 473 if (EQ (frame, Qnil))
474 { 474 {
475 s = selected_screen; 475 f = selected_frame;
476 XSET (screen, Lisp_Screen, s); 476 XSET (frame, Lisp_Frame, f);
477 } 477 }
478 else 478 else
479 { 479 {
480 CHECK_SCREEN (screen, 0); 480 CHECK_FRAME (frame, 0);
481 s = XSCREEN (screen); 481 f = XFRAME (frame);
482 } 482 }
483 483
484 if (! SCREEN_LIVE_P (s)) 484 if (! FRAME_LIVE_P (f))
485 return; 485 return;
486 486
487 /* Are there any other screens besides this one? */ 487 /* Are there any other frames besides this one? */
488 if (s == selected_screen && EQ (next_screen (screen, Qt), screen)) 488 if (f == selected_frame && EQ (next_frame (frame, Qt), frame))
489 error ("Attempt to delete the only screen"); 489 error ("Attempt to delete the only frame");
490 490
491 /* Does this screen have a minibuffer, and is it the surrogate 491 /* Does this frame have a minibuffer, and is it the surrogate
492 minibuffer for any other screen? */ 492 minibuffer for any other frame? */
493 if (SCREEN_HAS_MINIBUF (XSCREEN (screen))) 493 if (FRAME_HAS_MINIBUF (XFRAME (frame)))
494 { 494 {
495 Lisp_Object screens; 495 Lisp_Object frames;
496 496
497 for (screens = Vscreen_list; 497 for (frames = Vframe_list;
498 CONSP (screens); 498 CONSP (frames);
499 screens = XCONS (screens)->cdr) 499 frames = XCONS (frames)->cdr)
500 { 500 {
501 Lisp_Object this = XCONS (screens)->car; 501 Lisp_Object this = XCONS (frames)->car;
502 502
503 if (! EQ (this, screen) 503 if (! EQ (this, frame)
504 && EQ (screen, 504 && EQ (frame,
505 (WINDOW_SCREEN 505 (WINDOW_FRAME
506 (XWINDOW 506 (XWINDOW
507 (SCREEN_MINIBUF_WINDOW 507 (FRAME_MINIBUF_WINDOW
508 (XSCREEN (this))))))) 508 (XFRAME (this)))))))
509 error ("Attempt to delete a surrogate minibuffer screen"); 509 error ("Attempt to delete a surrogate minibuffer frame");
510 } 510 }
511 } 511 }
512 512
513 /* Don't let the screen remain selected. */ 513 /* Don't let the frame remain selected. */
514 if (s == selected_screen) 514 if (f == selected_frame)
515 Fselect_screen (next_screen (screen, Qt)); 515 Fselect_frame (next_frame (frame, Qt));
516 516
517 /* Don't allow minibuf_window to remain on a deleted screen. */ 517 /* Don't allow minibuf_window to remain on a deleted frame. */
518 if (EQ (s->minibuffer_window, minibuf_window)) 518 if (EQ (f->minibuffer_window, minibuf_window))
519 { 519 {
520 Fset_window_buffer (selected_screen->minibuffer_window, 520 Fset_window_buffer (selected_frame->minibuffer_window,
521 XWINDOW (minibuf_window)->buffer); 521 XWINDOW (minibuf_window)->buffer);
522 minibuf_window = selected_screen->minibuffer_window; 522 minibuf_window = selected_frame->minibuffer_window;
523 } 523 }
524 524
525 Vscreen_list = Fdelq (screen, Vscreen_list); 525 Vframe_list = Fdelq (frame, Vframe_list);
526 s->visible = 0; 526 f->visible = 0;
527 displ = s->display; 527 displ = f->display;
528 s->display.nothing = 0; 528 f->display.nothing = 0;
529 529
530#ifdef HAVE_X_WINDOWS 530#ifdef HAVE_X_WINDOWS
531 if (SCREEN_IS_X (s)) 531 if (FRAME_IS_X (f))
532 x_destroy_window (s, displ); 532 x_destroy_window (f, displ);
533#endif 533#endif
534 534
535 /* If we've deleted the last_nonminibuf_screen, then try to find 535 /* If we've deleted the last_nonminibuf_frame, then try to find
536 another one. */ 536 another one. */
537 if (s == last_nonminibuf_screen) 537 if (f == last_nonminibuf_frame)
538 { 538 {
539 Lisp_Object screens; 539 Lisp_Object frames;
540 540
541 last_nonminibuf_screen = 0; 541 last_nonminibuf_frame = 0;
542 542
543 for (screens = Vscreen_list; 543 for (frames = Vframe_list;
544 CONSP (screens); 544 CONSP (frames);
545 screens = XCONS (screens)->cdr) 545 frames = XCONS (frames)->cdr)
546 { 546 {
547 s = XSCREEN (XCONS (screens)->car); 547 f = XFRAME (XCONS (frames)->car);
548 if (!SCREEN_MINIBUF_ONLY_P (s)) 548 if (!FRAME_MINIBUF_ONLY_P (f))
549 { 549 {
550 last_nonminibuf_screen = s; 550 last_nonminibuf_frame = f;
551 break; 551 break;
552 } 552 }
553 } 553 }
554 } 554 }
555 555
556 /* If we've deleted Vdefault_minibuffer_screen, try to find another 556 /* If we've deleted Vdefault_minibuffer_frame, try to find another
557 one. Prefer minibuffer-only screens, but also notice screens 557 one. Prefer minibuffer-only frames, but also notice frames
558 with other windows. */ 558 with other windows. */
559 if (EQ (screen, Vdefault_minibuffer_screen)) 559 if (EQ (frame, Vdefault_minibuffer_frame))
560 { 560 {
561 Lisp_Object screens; 561 Lisp_Object frames;
562 562
563 /* The last screen we saw with a minibuffer, minibuffer-only or not. */ 563 /* The last frame we saw with a minibuffer, minibuffer-only or not. */
564 Lisp_Object screen_with_minibuf = Qnil; 564 Lisp_Object frame_with_minibuf = Qnil;
565 565
566 for (screens = Vscreen_list; 566 for (frames = Vframe_list;
567 CONSP (screens); 567 CONSP (frames);
568 screens = XCONS (screens)->cdr) 568 frames = XCONS (frames)->cdr)
569 { 569 {
570 Lisp_Object this = XCONS (screens)->car; 570 Lisp_Object this = XCONS (frames)->car;
571 571
572 if (XTYPE (this) != Lisp_Screen) 572 if (XTYPE (this) != Lisp_Frame)
573 abort (); 573 abort ();
574 s = XSCREEN (this); 574 f = XFRAME (this);
575 575
576 if (SCREEN_HAS_MINIBUF (s)) 576 if (FRAME_HAS_MINIBUF (f))
577 { 577 {
578 screen_with_minibuf = this; 578 frame_with_minibuf = this;
579 if (SCREEN_MINIBUF_ONLY_P (s)) 579 if (FRAME_MINIBUF_ONLY_P (f))
580 break; 580 break;
581 } 581 }
582 } 582 }
583 583
584 /* We know that there must be some screen with a minibuffer out 584 /* We know that there must be some frame with a minibuffer out
585 there. If this were not true, all of the screens present 585 there. If this were not true, all of the frames present
586 would have to be minibufferless, which implies that at some 586 would have to be minibufferless, which implies that at some
587 point their minibuffer screens must have been deleted, but 587 point their minibuffer frames must have been deleted, but
588 that is prohibited at the top; you can't delete surrogate 588 that is prohibited at the top; you can't delete surrogate
589 minibuffer screens. */ 589 minibuffer frames. */
590 if (NILP (screen_with_minibuf)) 590 if (NILP (frame_with_minibuf))
591 abort (); 591 abort ();
592 592
593 Vdefault_minibuffer_screen = screen_with_minibuf; 593 Vdefault_minibuffer_frame = frame_with_minibuf;
594 } 594 }
595 595
596 return Qnil; 596 return Qnil;
@@ -599,41 +599,41 @@ A screen may not be deleted if its minibuffer is used by other screens.")
599/* Return mouse position in character cell units. */ 599/* Return mouse position in character cell units. */
600 600
601DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, 601DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0,
602 "Return a list (SCREEN X . Y) giving the current mouse screen and position.\n\ 602 "Return a list (FRAME X . Y) giving the current mouse frame and position.\n\
603If Emacs is running on a mouseless terminal or hasn't been programmed\n\ 603If Emacs is running on a mouseless terminal or hasn't been programmed\n\
604to read the mouse position, it returns the selected screen for SCREEN\n\ 604to read the mouse position, it returns the selected frame for FRAME\n\
605and nil for X and Y.") 605and nil for X and Y.")
606 () 606 ()
607{ 607{
608 Lisp_Object x, y, dummy; 608 Lisp_Object x, y, dummy;
609 SCREEN_PTR s; 609 FRAME_PTR f;
610 610
611 if (mouse_position_hook) 611 if (mouse_position_hook)
612 (*mouse_position_hook) (&s, &x, &y, &dummy); 612 (*mouse_position_hook) (&f, &x, &y, &dummy);
613 else 613 else
614 { 614 {
615 s = selected_screen; 615 f = selected_frame;
616 x = y = Qnil; 616 x = y = Qnil;
617 } 617 }
618 618
619 XSET (dummy, Lisp_Screen, s); 619 XSET (dummy, Lisp_Frame, f);
620 return Fcons (dummy, Fcons (make_number (x), make_number (y))); 620 return Fcons (dummy, Fcons (make_number (x), make_number (y)));
621} 621}
622 622
623DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0, 623DEFUN ("set-mouse-position", Fset_mouse_position, Sset_mouse_position, 3, 3, 0,
624 "Move the mouse pointer to the center of cell (X,Y) in SCREEN.\n\ 624 "Move the mouse pointer to the center of cell (X,Y) in FRAME.\n\
625WARNING: If you use this under X, you should do `unfocus-screen' afterwards.") 625WARNING: If you use this under X, you should do `unfocus-frame' afterwards.")
626 (screen, x, y) 626 (frame, x, y)
627 Lisp_Object screen, x, y; 627 Lisp_Object frame, x, y;
628{ 628{
629 CHECK_LIVE_SCREEN (screen, 0); 629 CHECK_LIVE_FRAME (frame, 0);
630 CHECK_NUMBER (x, 2); 630 CHECK_NUMBER (x, 2);
631 CHECK_NUMBER (y, 1); 631 CHECK_NUMBER (y, 1);
632 632
633#ifdef HAVE_X_WINDOWS 633#ifdef HAVE_X_WINDOWS
634 if (SCREEN_IS_X (XSCREEN (screen))) 634 if (FRAME_IS_X (XFRAME (frame)))
635 /* Warping the mouse will cause enternotify and focus events. */ 635 /* Warping the mouse will cause enternotify and focus events. */
636 x_set_mouse_position (XSCREEN (screen), x, y); 636 x_set_mouse_position (XFRAME (frame), x, y);
637#endif 637#endif
638 638
639 return Qnil; 639 return Qnil;
@@ -643,20 +643,20 @@ WARNING: If you use this under X, you should do `unfocus-screen' afterwards.")
643/* ??? Can this be replaced with a Lisp function? 643/* ??? Can this be replaced with a Lisp function?
644 It is used in minibuf.c. Can we get rid of that? 644 It is used in minibuf.c. Can we get rid of that?
645 Yes. All uses in minibuf.c are gone, and parallels to these 645 Yes. All uses in minibuf.c are gone, and parallels to these
646 functions have been defined in screen.el. */ 646 functions have been defined in frame.el. */
647 647
648DEFUN ("screen-configuration", Fscreen_configuration, Sscreen_configuration, 648DEFUN ("frame-configuration", Fframe_configuration, Sframe_configuration,
649 0, 0, 0, 649 0, 0, 0,
650 "Return object describing current screen configuration.\n\ 650 "Return object describing current frame configuration.\n\
651The screen configuration is the current mouse position and selected screen.\n\ 651The frame configuration is the current mouse position and selected frame.\n\
652This object can be given to `restore-screen-configuration'\n\ 652This object can be given to `restore-frame-configuration'\n\
653to restore this screen configuration.") 653to restore this frame configuration.")
654 () 654 ()
655{ 655{
656 Lisp_Object c, time; 656 Lisp_Object c, time;
657 657
658 c = Fmake_vector (make_number(4), Qnil); 658 c = Fmake_vector (make_number(4), Qnil);
659 XVECTOR (c)->contents[0] = Fselected_screen(); 659 XVECTOR (c)->contents[0] = Fselected_frame();
660 if (mouse_position_hook) 660 if (mouse_position_hook)
661 (*mouse_position_hook) (&XVECTOR (c)->contents[1] 661 (*mouse_position_hook) (&XVECTOR (c)->contents[1]
662 &XVECTOR (c)->contents[2], 662 &XVECTOR (c)->contents[2],
@@ -665,174 +665,174 @@ to restore this screen configuration.")
665 return c; 665 return c;
666} 666}
667 667
668DEFUN ("restore-screen-configuration", Frestore_screen_configuration, 668DEFUN ("restore-frame-configuration", Frestore_frame_configuration,
669 Srestore_screen_configuration, 669 Srestore_frame_configuration,
670 1, 1, 0, 670 1, 1, 0,
671 "Restores screen configuration CONFIGURATION.") 671 "Restores frame configuration CONFIGURATION.")
672 (config) 672 (config)
673 Lisp_Object config; 673 Lisp_Object config;
674{ 674{
675 Lisp_Object x_pos, y_pos, screen; 675 Lisp_Object x_pos, y_pos, frame;
676 676
677 CHECK_VECTOR (config, 0); 677 CHECK_VECTOR (config, 0);
678 if (XVECTOR (config)->size != 3) 678 if (XVECTOR (config)->size != 3)
679 { 679 {
680 error ("Wrong size vector passed to restore-screen-configuration"); 680 error ("Wrong size vector passed to restore-frame-configuration");
681 } 681 }
682 screen = XVECTOR (config)->contents[0]; 682 frame = XVECTOR (config)->contents[0];
683 CHECK_LIVE_SCREEN (screen, 0); 683 CHECK_LIVE_FRAME (frame, 0);
684 684
685 Fselect_screen (screen, Qnil); 685 Fselect_frame (frame, Qnil);
686 686
687#if 0 687#if 0
688 /* This seems to interfere with the screen selection mechanism. jla */ 688 /* This seems to interfere with the frame selection mechanism. jla */
689 x_pos = XVECTOR (config)->contents[2]; 689 x_pos = XVECTOR (config)->contents[2];
690 y_pos = XVECTOR (config)->contents[3]; 690 y_pos = XVECTOR (config)->contents[3];
691 set_mouse_position (screen, XINT (x_pos), XINT (y_pos)); 691 set_mouse_position (frame, XINT (x_pos), XINT (y_pos));
692#endif 692#endif
693 693
694 return screen; 694 return frame;
695} 695}
696#endif 696#endif
697 697
698DEFUN ("make-screen-visible", Fmake_screen_visible, Smake_screen_visible, 698DEFUN ("make-frame-visible", Fmake_frame_visible, Smake_frame_visible,
699 1, 1, 0, 699 1, 1, 0,
700 "Make the screen SCREEN visible (assuming it is an X-window).\n\ 700 "Make the frame FRAME visible (assuming it is an X-window).\n\
701Also raises the screen so that nothing obscures it.") 701Also raises the frame so that nothing obscures it.")
702 (screen) 702 (frame)
703 Lisp_Object screen; 703 Lisp_Object frame;
704{ 704{
705 CHECK_LIVE_SCREEN (screen, 0); 705 CHECK_LIVE_FRAME (frame, 0);
706 706
707 if (SCREEN_IS_X (XSCREEN (screen))) 707 if (FRAME_IS_X (XFRAME (frame)))
708 x_make_screen_visible (XSCREEN (screen)); 708 x_make_frame_visible (XFRAME (frame));
709 709
710 return screen; 710 return frame;
711} 711}
712 712
713DEFUN ("make-screen-invisible", Fmake_screen_invisible, Smake_screen_invisible, 713DEFUN ("make-frame-invisible", Fmake_frame_invisible, Smake_frame_invisible,
714 1, 1, 0, 714 1, 1, 0,
715 "Make the screen SCREEN invisible (assuming it is an X-window).") 715 "Make the frame FRAME invisible (assuming it is an X-window).")
716 (screen) 716 (frame)
717 Lisp_Object screen; 717 Lisp_Object frame;
718{ 718{
719 CHECK_LIVE_SCREEN (screen, 0); 719 CHECK_LIVE_FRAME (frame, 0);
720 720
721 if (SCREEN_IS_X (XSCREEN (screen))) 721 if (FRAME_IS_X (XFRAME (frame)))
722 x_make_screen_invisible (XSCREEN (screen)); 722 x_make_frame_invisible (XFRAME (frame));
723 723
724 return Qnil; 724 return Qnil;
725} 725}
726 726
727DEFUN ("iconify-screen", Ficonify_screen, Siconify_screen, 727DEFUN ("iconify-frame", Ficonify_frame, Siconify_frame,
728 1, 1, 0, 728 1, 1, 0,
729 "Make the screen SCREEN into an icon.") 729 "Make the frame FRAME into an icon.")
730 (screen) 730 (frame)
731 Lisp_Object screen; 731 Lisp_Object frame;
732{ 732{
733 CHECK_LIVE_SCREEN (screen, 0); 733 CHECK_LIVE_FRAME (frame, 0);
734 734
735 if (SCREEN_IS_X (XSCREEN (screen))) 735 if (FRAME_IS_X (XFRAME (frame)))
736 x_iconify_screen (XSCREEN (screen)); 736 x_iconify_frame (XFRAME (frame));
737 737
738 return Qnil; 738 return Qnil;
739} 739}
740 740
741DEFUN ("screen-visible-p", Fscreen_visible_p, Sscreen_visible_p, 741DEFUN ("frame-visible-p", Fframe_visible_p, Sframe_visible_p,
742 1, 1, 0, 742 1, 1, 0,
743 "Return t if SCREEN is now \"visible\" (actually in use for display).\n\ 743 "Return t if FRAME is now \"visible\" (actually in use for display).\n\
744A screen that is not \"visible\" is not updated and, if it works through\n\ 744A frame that is not \"visible\" is not updated and, if it works through\n\
745a window system, it may not show at all.\n\ 745a window system, it may not show at all.\n\
746Return the symbol `icon' if window is visible only as an icon.") 746Return the symbol `icon' if window is visible only as an icon.")
747 (screen) 747 (frame)
748 Lisp_Object screen; 748 Lisp_Object frame;
749{ 749{
750 CHECK_LIVE_SCREEN (screen, 0); 750 CHECK_LIVE_FRAME (frame, 0);
751 751
752 if (XSCREEN (screen)->visible) 752 if (XFRAME (frame)->visible)
753 return Qt; 753 return Qt;
754 if (XSCREEN (screen)->iconified) 754 if (XFRAME (frame)->iconified)
755 return intern ("icon"); 755 return intern ("icon");
756 return Qnil; 756 return Qnil;
757} 757}
758 758
759DEFUN ("visible-screen-list", Fvisible_screen_list, Svisible_screen_list, 759DEFUN ("visible-frame-list", Fvisible_frame_list, Svisible_frame_list,
760 0, 0, 0, 760 0, 0, 0,
761 "Return a list of all screens now \"visible\" (being updated).") 761 "Return a list of all frames now \"visible\" (being updated).")
762 () 762 ()
763{ 763{
764 Lisp_Object tail, screen; 764 Lisp_Object tail, frame;
765 struct screen *s; 765 struct frame *f;
766 Lisp_Object value; 766 Lisp_Object value;
767 767
768 value = Qnil; 768 value = Qnil;
769 for (tail = Vscreen_list; CONSP (tail); tail = XCONS (tail)->cdr) 769 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
770 { 770 {
771 screen = XCONS (tail)->car; 771 frame = XCONS (tail)->car;
772 if (XTYPE (screen) != Lisp_Screen) 772 if (XTYPE (frame) != Lisp_Frame)
773 continue; 773 continue;
774 s = XSCREEN (screen); 774 f = XFRAME (frame);
775 if (s->visible) 775 if (f->visible)
776 value = Fcons (screen, value); 776 value = Fcons (frame, value);
777 } 777 }
778 return value; 778 return value;
779} 779}
780 780
781 781
782 782
783DEFUN ("redirect-screen-focus", Fredirect_screen_focus, Sredirect_screen_focus, 783DEFUN ("redirect-frame-focus", Fredirect_frame_focus, Sredirect_frame_focus,
784 1, 2, 0, 784 1, 2, 0,
785 "Arrange for keystrokes typed at SCREEN to be sent to FOCUS-SCREEN.\n\ 785 "Arrange for keystrokes typed at FRAME to be sent to FOCUS-FRAME.\n\
786This means that, after reading a keystroke typed at SCREEN,\n\ 786This means that, after reading a keystroke typed at FRAME,\n\
787`last-event-screen' will be FOCUS-SCREEN.\n\ 787`last-event-frame' will be FOCUS-FRAME.\n\
788\n\ 788\n\
789If FOCUS-SCREEN is omitted or eq to SCREEN, any existing redirection is\n\ 789If FOCUS-FRAME is omitted or eq to FRAME, any existing redirection is\n\
790cancelled, and the screen again receives its own keystrokes.\n\ 790cancelled, and the frame again receives its own keystrokes.\n\
791\n\ 791\n\
792The redirection lasts until the next call to `redirect-screen-focus'\n\ 792The redirection lasts until the next call to `redirect-frame-focus'\n\
793or `select-screen'.\n\ 793or `select-frame'.\n\
794\n\ 794\n\
795This is useful for temporarily redirecting keystrokes to the minibuffer\n\ 795This is useful for temporarily redirecting keystrokes to the minibuffer\n\
796window when a screen doesn't have its own minibuffer.") 796window when a frame doesn't have its own minibuffer.")
797 (screen, focus_screen) 797 (frame, focus_frame)
798 Lisp_Object screen, focus_screen; 798 Lisp_Object frame, focus_frame;
799{ 799{
800 CHECK_LIVE_SCREEN (screen, 0); 800 CHECK_LIVE_FRAME (frame, 0);
801 801
802 if (NILP (focus_screen)) 802 if (NILP (focus_frame))
803 focus_screen = screen; 803 focus_frame = frame;
804 else 804 else
805 CHECK_LIVE_SCREEN (focus_screen, 1); 805 CHECK_LIVE_FRAME (focus_frame, 1);
806 806
807 XSCREEN (screen)->focus_screen = focus_screen; 807 XFRAME (frame)->focus_frame = focus_frame;
808 808
809 if (screen_rehighlight_hook) 809 if (frame_rehighlight_hook)
810 (*screen_rehighlight_hook) (); 810 (*frame_rehighlight_hook) ();
811 811
812 return Qnil; 812 return Qnil;
813} 813}
814 814
815 815
816DEFUN ("screen-focus", Fscreen_focus, Sscreen_focus, 1, 1, 0, 816DEFUN ("frame-focus", Fframe_focus, Sframe_focus, 1, 1, 0,
817 "Return the screen to which SCREEN's keystrokes are currently being sent.\n\ 817 "Return the frame to which FRAME's keystrokes are currently being sent.\n\
818See `redirect-screen-focus'.") 818See `redirect-frame-focus'.")
819 (screen) 819 (frame)
820 Lisp_Object screen; 820 Lisp_Object frame;
821{ 821{
822 CHECK_LIVE_SCREEN (screen, 0); 822 CHECK_LIVE_FRAME (frame, 0);
823 return SCREEN_FOCUS_SCREEN (XSCREEN (screen)); 823 return FRAME_FOCUS_FRAME (XFRAME (frame));
824} 824}
825 825
826 826
827 827
828Lisp_Object 828Lisp_Object
829get_screen_param (screen, prop) 829get_frame_param (frame, prop)
830 register struct screen *screen; 830 register struct frame *frame;
831 Lisp_Object prop; 831 Lisp_Object prop;
832{ 832{
833 register Lisp_Object tem; 833 register Lisp_Object tem;
834 834
835 tem = Fassq (prop, screen->param_alist); 835 tem = Fassq (prop, frame->param_alist);
836 if (EQ (tem, Qnil)) 836 if (EQ (tem, Qnil))
837 return tem; 837 return tem;
838 return Fcdr (tem); 838 return Fcdr (tem);
@@ -855,15 +855,15 @@ store_in_alist (alistptr, propname, val)
855} 855}
856 856
857void 857void
858store_screen_param (s, prop, val) 858store_frame_param (f, prop, val)
859 struct screen *s; 859 struct frame *f;
860 Lisp_Object prop, val; 860 Lisp_Object prop, val;
861{ 861{
862 register Lisp_Object tem; 862 register Lisp_Object tem;
863 863
864 tem = Fassq (prop, s->param_alist); 864 tem = Fassq (prop, f->param_alist);
865 if (EQ (tem, Qnil)) 865 if (EQ (tem, Qnil))
866 s->param_alist = Fcons (Fcons (prop, val), s->param_alist); 866 f->param_alist = Fcons (Fcons (prop, val), f->param_alist);
867 else 867 else
868 Fsetcdr (tem, val); 868 Fsetcdr (tem, val);
869 869
@@ -873,214 +873,214 @@ store_screen_param (s, prop, val)
873 if (! MINI_WINDOW_P (XWINDOW (val))) 873 if (! MINI_WINDOW_P (XWINDOW (val)))
874 error ("Surrogate minibuffer windows must be minibuffer windows."); 874 error ("Surrogate minibuffer windows must be minibuffer windows.");
875 875
876 if (SCREEN_HAS_MINIBUF (s) || SCREEN_MINIBUF_ONLY_P (s)) 876 if (FRAME_HAS_MINIBUF (f) || FRAME_MINIBUF_ONLY_P (f))
877 error ("Can't change the surrogate minibuffer of a screen with its own minibuffer."); 877 error ("Can't change the surrogate minibuffer of a frame with its own minibuffer.");
878 878
879 /* Install the chosen minibuffer window, with proper buffer. */ 879 /* Install the chosen minibuffer window, with proper buffer. */
880 s->minibuffer_window = val; 880 f->minibuffer_window = val;
881 } 881 }
882} 882}
883 883
884DEFUN ("screen-parameters", Fscreen_parameters, Sscreen_parameters, 0, 1, 0, 884DEFUN ("frame-parameters", Fframe_parameters, Sframe_parameters, 0, 1, 0,
885 "Return the parameters-alist of screen SCREEN.\n\ 885 "Return the parameters-alist of frame FRAME.\n\
886It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\ 886It is a list of elements of the form (PARM . VALUE), where PARM is a symbol.\n\
887The meaningful PARMs depend on the kind of screen.") 887The meaningful PARMs depend on the kind of frame.")
888 (screen) 888 (frame)
889 Lisp_Object screen; 889 Lisp_Object frame;
890{ 890{
891 Lisp_Object alist; 891 Lisp_Object alist;
892 struct screen *s; 892 struct frame *f;
893 893
894 if (EQ (screen, Qnil)) 894 if (EQ (frame, Qnil))
895 s = selected_screen; 895 f = selected_frame;
896 else 896 else
897 { 897 {
898 CHECK_SCREEN (screen, 0); 898 CHECK_FRAME (frame, 0);
899 s = XSCREEN (screen); 899 f = XFRAME (frame);
900 } 900 }
901 901
902 if (s->display.nothing == 0) 902 if (f->display.nothing == 0)
903 return Qnil; 903 return Qnil;
904 904
905 alist = Fcopy_alist (s->param_alist); 905 alist = Fcopy_alist (f->param_alist);
906 store_in_alist (&alist, "name", s->name); 906 store_in_alist (&alist, "name", f->name);
907 store_in_alist (&alist, "height", make_number (s->height)); 907 store_in_alist (&alist, "height", make_number (f->height));
908 store_in_alist (&alist, "width", make_number (s->width)); 908 store_in_alist (&alist, "width", make_number (f->width));
909 store_in_alist (&alist, "modeline", (s->wants_modeline ? Qt : Qnil)); 909 store_in_alist (&alist, "modeline", (f->wants_modeline ? Qt : Qnil));
910 store_in_alist (&alist, "minibuffer", 910 store_in_alist (&alist, "minibuffer",
911 (SCREEN_HAS_MINIBUF (s) 911 (FRAME_HAS_MINIBUF (f)
912 ? (SCREEN_MINIBUF_ONLY_P (s) ? intern ("only") : Qt) 912 ? (FRAME_MINIBUF_ONLY_P (f) ? intern ("only") : Qt)
913 : SCREEN_MINIBUF_WINDOW (s))); 913 : FRAME_MINIBUF_WINDOW (f)));
914 store_in_alist (&alist, "unsplittable", (s->no_split ? Qt : Qnil)); 914 store_in_alist (&alist, "unsplittable", (f->no_split ? Qt : Qnil));
915 915
916 if (SCREEN_IS_X (s)) 916 if (FRAME_IS_X (f))
917 x_report_screen_params (s, &alist); 917 x_report_frame_params (f, &alist);
918 return alist; 918 return alist;
919} 919}
920 920
921DEFUN ("modify-screen-parameters", Fmodify_screen_parameters, 921DEFUN ("modify-frame-parameters", Fmodify_frame_parameters,
922 Smodify_screen_parameters, 2, 2, 0, 922 Smodify_frame_parameters, 2, 2, 0,
923 "Modify the parameters of screen SCREEN according to ALIST.\n\ 923 "Modify the parameters of frame FRAME according to ALIST.\n\
924ALIST is an alist of parameters to change and their new values.\n\ 924ALIST is an alist of parameters to change and their new values.\n\
925Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\ 925Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.\n\
926The meaningful PARMs depend on the kind of screen; undefined PARMs are ignored.") 926The meaningful PARMs depend on the kind of frame; undefined PARMs are ignored.")
927 (screen, alist) 927 (frame, alist)
928 Lisp_Object screen, alist; 928 Lisp_Object frame, alist;
929{ 929{
930 register struct screen *s; 930 register struct frame *f;
931 register Lisp_Object tail, elt, prop, val; 931 register Lisp_Object tail, elt, prop, val;
932 932
933 if (EQ (screen, Qnil)) 933 if (EQ (frame, Qnil))
934 s = selected_screen; 934 f = selected_frame;
935 else 935 else
936 { 936 {
937 CHECK_LIVE_SCREEN (screen, 0); 937 CHECK_LIVE_FRAME (frame, 0);
938 s = XSCREEN (screen); 938 f = XFRAME (frame);
939 } 939 }
940 940
941 if (SCREEN_IS_X (s)) 941 if (FRAME_IS_X (f))
942 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail)) 942 for (tail = alist; !EQ (tail, Qnil); tail = Fcdr (tail))
943 { 943 {
944 elt = Fcar (tail); 944 elt = Fcar (tail);
945 prop = Fcar (elt); 945 prop = Fcar (elt);
946 val = Fcdr (elt); 946 val = Fcdr (elt);
947 x_set_screen_param (s, prop, val, 947 x_set_frame_param (f, prop, val,
948 get_screen_param (s, prop)); 948 get_frame_param (f, prop));
949 store_screen_param (s, prop, val); 949 store_frame_param (f, prop, val);
950 } 950 }
951 951
952 return Qnil; 952 return Qnil;
953} 953}
954 954
955 955
956DEFUN ("screen-pixel-size", Fscreen_pixel_size, 956DEFUN ("frame-pixel-size", Fframe_pixel_size,
957 Sscreen_pixel_size, 1, 1, 0, 957 Sframe_pixel_size, 1, 1, 0,
958 "Return a cons (width . height) of SCREEN's size in pixels.") 958 "Return a cons (width . height) of FRAME's size in pixels.")
959 (screen) 959 (frame)
960 Lisp_Object screen; 960 Lisp_Object frame;
961{ 961{
962 register struct screen *s; 962 register struct frame *f;
963 int width, height; 963 int width, height;
964 964
965 CHECK_LIVE_SCREEN (screen, 0); 965 CHECK_LIVE_FRAME (frame, 0);
966 s = XSCREEN (screen); 966 f = XFRAME (frame);
967 967
968 return Fcons (make_number (x_pixel_width (s)), 968 return Fcons (make_number (x_pixel_width (f)),
969 make_number (x_pixel_height (s))); 969 make_number (x_pixel_height (f)));
970} 970}
971 971
972DEFUN ("screen-height", Fscreen_height, Sscreen_height, 0, 0, 0, 972DEFUN ("frame-height", Fframe_height, Sframe_height, 0, 0, 0,
973 "Return number of lines available for display on selected screen.") 973 "Return number of lines available for display on selected frame.")
974 () 974 ()
975{ 975{
976 return make_number (SCREEN_HEIGHT (selected_screen)); 976 return make_number (FRAME_HEIGHT (selected_frame));
977} 977}
978 978
979DEFUN ("screen-width", Fscreen_width, Sscreen_width, 0, 0, 0, 979DEFUN ("frame-width", Fframe_width, Sframe_width, 0, 0, 0,
980 "Return number of columns available for display on selected screen.") 980 "Return number of columns available for display on selected frame.")
981 () 981 ()
982{ 982{
983 return make_number (SCREEN_WIDTH (selected_screen)); 983 return make_number (FRAME_WIDTH (selected_frame));
984} 984}
985 985
986DEFUN ("set-screen-height", Fset_screen_height, Sset_screen_height, 2, 3, 0, 986DEFUN ("set-frame-height", Fset_frame_height, Sset_frame_height, 2, 3, 0,
987 "Specify that the screen SCREEN has LINES lines.\n\ 987 "Specify that the frame FRAME has LINES lines.\n\
988Optional third arg non-nil means that redisplay should use LINES lines\n\ 988Optional third arg non-nil means that redisplay should use LINES lines\n\
989but that the idea of the actual height of the screen should not be changed.") 989but that the idea of the actual height of the frame should not be changed.")
990 (screen, rows, pretend) 990 (frame, rows, pretend)
991 Lisp_Object rows, pretend; 991 Lisp_Object rows, pretend;
992{ 992{
993 register struct screen *s; 993 register struct frame *f;
994 994
995 CHECK_NUMBER (rows, 0); 995 CHECK_NUMBER (rows, 0);
996 if (NILP (screen)) 996 if (NILP (frame))
997 s = selected_screen; 997 f = selected_frame;
998 else 998 else
999 { 999 {
1000 CHECK_LIVE_SCREEN (screen, 0); 1000 CHECK_LIVE_FRAME (frame, 0);
1001 s = XSCREEN (screen); 1001 f = XFRAME (frame);
1002 } 1002 }
1003 1003
1004 if (SCREEN_IS_X (s)) 1004 if (FRAME_IS_X (f))
1005 { 1005 {
1006 if (XINT (rows) != s->width) 1006 if (XINT (rows) != f->width)
1007 x_set_window_size (s, s->width, XINT (rows)); 1007 x_set_window_size (f, f->width, XINT (rows));
1008 } 1008 }
1009 else 1009 else
1010 change_screen_size (s, XINT (rows), 0, !NILP (pretend)); 1010 change_frame_size (f, XINT (rows), 0, !NILP (pretend));
1011 return Qnil; 1011 return Qnil;
1012} 1012}
1013 1013
1014DEFUN ("set-screen-width", Fset_screen_width, Sset_screen_width, 2, 3, 0, 1014DEFUN ("set-frame-width", Fset_frame_width, Sset_frame_width, 2, 3, 0,
1015 "Specify that the screen SCREEN has COLS columns.\n\ 1015 "Specify that the frame FRAME has COLS columns.\n\
1016Optional third arg non-nil means that redisplay should use COLS columns\n\ 1016Optional third arg non-nil means that redisplay should use COLS columns\n\
1017but that the idea of the actual width of the screen should not be changed.") 1017but that the idea of the actual width of the frame should not be changed.")
1018 (screen, cols, pretend) 1018 (frame, cols, pretend)
1019 Lisp_Object cols, pretend; 1019 Lisp_Object cols, pretend;
1020{ 1020{
1021 register struct screen *s; 1021 register struct frame *f;
1022 CHECK_NUMBER (cols, 0); 1022 CHECK_NUMBER (cols, 0);
1023 if (NILP (screen)) 1023 if (NILP (frame))
1024 s = selected_screen; 1024 f = selected_frame;
1025 else 1025 else
1026 { 1026 {
1027 CHECK_LIVE_SCREEN (screen, 0); 1027 CHECK_LIVE_FRAME (frame, 0);
1028 s = XSCREEN (screen); 1028 f = XFRAME (frame);
1029 } 1029 }
1030 1030
1031 if (SCREEN_IS_X (s)) 1031 if (FRAME_IS_X (f))
1032 { 1032 {
1033 if (XINT (cols) != s->width) 1033 if (XINT (cols) != f->width)
1034 x_set_window_size (s, XINT (cols), s->height); 1034 x_set_window_size (f, XINT (cols), f->height);
1035 } 1035 }
1036 else 1036 else
1037 change_screen_size (selected_screen, 0, XINT (cols), !NILP (pretend)); 1037 change_frame_size (selected_frame, 0, XINT (cols), !NILP (pretend));
1038 return Qnil; 1038 return Qnil;
1039} 1039}
1040 1040
1041DEFUN ("set-screen-size", Fset_screen_size, Sset_screen_size, 3, 3, 0, 1041DEFUN ("set-frame-size", Fset_frame_size, Sset_frame_size, 3, 3, 0,
1042 "Sets size of SCREEN to COLS by ROWS, measured in characters.") 1042 "Sets size of FRAME to COLS by ROWS, measured in characters.")
1043 (screen, cols, rows) 1043 (frame, cols, rows)
1044 Lisp_Object screen, cols, rows; 1044 Lisp_Object frame, cols, rows;
1045{ 1045{
1046 register struct screen *s; 1046 register struct frame *f;
1047 int mask; 1047 int mask;
1048 1048
1049 CHECK_LIVE_SCREEN (screen, 0); 1049 CHECK_LIVE_FRAME (frame, 0);
1050 CHECK_NUMBER (cols, 2); 1050 CHECK_NUMBER (cols, 2);
1051 CHECK_NUMBER (rows, 1); 1051 CHECK_NUMBER (rows, 1);
1052 s = XSCREEN (screen); 1052 f = XFRAME (frame);
1053 1053
1054 if (SCREEN_IS_X (s)) 1054 if (FRAME_IS_X (f))
1055 { 1055 {
1056 if (XINT (rows) != s->height || XINT (cols) != s->width) 1056 if (XINT (rows) != f->height || XINT (cols) != f->width)
1057 x_set_window_size (s, XINT (cols), XINT (rows)); 1057 x_set_window_size (f, XINT (cols), XINT (rows));
1058 } 1058 }
1059 else 1059 else
1060 change_screen_size (s, XINT (rows), XINT (cols), 0); 1060 change_frame_size (f, XINT (rows), XINT (cols), 0);
1061 1061
1062 return Qnil; 1062 return Qnil;
1063} 1063}
1064 1064
1065DEFUN ("set-screen-position", Fset_screen_position, 1065DEFUN ("set-frame-position", Fset_frame_position,
1066 Sset_screen_position, 3, 3, 0, 1066 Sset_frame_position, 3, 3, 0,
1067 "Sets position of SCREEN in pixels to XOFFSET by YOFFSET.\n\ 1067 "Sets position of FRAME in pixels to XOFFSET by YOFFSET.\n\
1068If XOFFSET or YOFFSET are negative, they are interpreted relative to\n\ 1068If XOFFSET or YOFFSET are negative, they are interpreted relative to\n\
1069the leftmost or bottommost position SCREEN could occupy without going\n\ 1069the leftmost or bottommost position FRAME could occupy without going\n\
1070off the screen.") 1070off the frame.")
1071 (screen, xoffset, yoffset) 1071 (frame, xoffset, yoffset)
1072 Lisp_Object screen, xoffset, yoffset; 1072 Lisp_Object frame, xoffset, yoffset;
1073{ 1073{
1074 register struct screen *s; 1074 register struct frame *f;
1075 int mask; 1075 int mask;
1076 1076
1077 CHECK_LIVE_SCREEN (screen, 0); 1077 CHECK_LIVE_FRAME (frame, 0);
1078 CHECK_NUMBER (xoffset, 1); 1078 CHECK_NUMBER (xoffset, 1);
1079 CHECK_NUMBER (yoffset, 2); 1079 CHECK_NUMBER (yoffset, 2);
1080 s = XSCREEN (screen); 1080 f = XFRAME (frame);
1081 1081
1082 if (SCREEN_IS_X (s)) 1082 if (FRAME_IS_X (f))
1083 x_set_offset (s, XINT (xoffset), XINT (yoffset)); 1083 x_set_offset (f, XINT (xoffset), XINT (yoffset));
1084 1084
1085 return Qt; 1085 return Qt;
1086} 1086}
@@ -1088,14 +1088,14 @@ off the screen.")
1088#ifndef HAVE_X11 1088#ifndef HAVE_X11
1089DEFUN ("rubber-band-rectangle", Frubber_band_rectangle, Srubber_band_rectangle, 1089DEFUN ("rubber-band-rectangle", Frubber_band_rectangle, Srubber_band_rectangle,
1090 3, 3, "", 1090 3, 3, "",
1091 "Ask user to specify a window position and size on SCREEN with the mouse.\n\ 1091 "Ask user to specify a window position and size on FRAME with the mouse.\n\
1092Arguments are SCREEN, NAME and GEO. NAME is a name to be displayed as\n\ 1092Arguments are FRAME, NAME and GEO. NAME is a name to be displayed as\n\
1093the purpose of this rectangle. GEO is an X-windows size spec that can\n\ 1093the purpose of this rectangle. GEO is an X-windows size spec that can\n\
1094specify defaults for some sizes/positions. If GEO specifies everything,\n\ 1094specify defaults for some sizes/positions. If GEO specifies everything,\n\
1095the mouse is not used.\n\ 1095the mouse is not used.\n\
1096Returns a list of five values: (SCREEN LEFT TOP WIDTH HEIGHT).") 1096Returns a list of five values: (FRAME LEFT TOP WIDTH HEIGHT).")
1097 (screen, name, geo) 1097 (frame, name, geo)
1098 Lisp_Object screen; 1098 Lisp_Object frame;
1099 Lisp_Object name; 1099 Lisp_Object name;
1100 Lisp_Object geo; 1100 Lisp_Object geo;
1101{ 1101{
@@ -1103,14 +1103,14 @@ Returns a list of five values: (SCREEN LEFT TOP WIDTH HEIGHT).")
1103 Lisp_Object nums[4]; 1103 Lisp_Object nums[4];
1104 int i; 1104 int i;
1105 1105
1106 CHECK_SCREEN (screen, 0); 1106 CHECK_FRAME (frame, 0);
1107 CHECK_STRING (name, 1); 1107 CHECK_STRING (name, 1);
1108 CHECK_STRING (geo, 2); 1108 CHECK_STRING (geo, 2);
1109 1109
1110 switch (XSCREEN (screen)->output_method) 1110 switch (XFRAME (frame)->output_method)
1111 { 1111 {
1112 case output_x_window: 1112 case output_x_window:
1113 x_rubber_band (XSCREEN (screen), &vals[0], &vals[1], &vals[2], &vals[3], 1113 x_rubber_band (XFRAME (frame), &vals[0], &vals[1], &vals[2], &vals[3],
1114 XSTRING (geo)->data, XSTRING (name)->data); 1114 XSTRING (geo)->data, XSTRING (name)->data);
1115 break; 1115 break;
1116 1116
@@ -1120,102 +1120,102 @@ Returns a list of five values: (SCREEN LEFT TOP WIDTH HEIGHT).")
1120 1120
1121 for (i = 0; i < 4; i++) 1121 for (i = 0; i < 4; i++)
1122 XFASTINT (nums[i]) = vals[i]; 1122 XFASTINT (nums[i]) = vals[i];
1123 return Fcons (screen, Flist (4, nums)); 1123 return Fcons (frame, Flist (4, nums));
1124 return Qnil; 1124 return Qnil;
1125} 1125}
1126#endif /* not HAVE_X11 */ 1126#endif /* not HAVE_X11 */
1127 1127
1128choose_minibuf_screen () 1128choose_minibuf_frame ()
1129{ 1129{
1130 /* For lowest-level minibuf, put it on currently selected screen 1130 /* For lowest-level minibuf, put it on currently selected frame
1131 if screen has a minibuffer. */ 1131 if frame has a minibuffer. */
1132 if (minibuf_level == 0 1132 if (minibuf_level == 0
1133 && selected_screen != 0 1133 && selected_frame != 0
1134 && !EQ (minibuf_window, selected_screen->minibuffer_window) 1134 && !EQ (minibuf_window, selected_frame->minibuffer_window)
1135 && !EQ (Qnil, selected_screen->minibuffer_window)) 1135 && !EQ (Qnil, selected_frame->minibuffer_window))
1136 { 1136 {
1137 Fset_window_buffer (selected_screen->minibuffer_window, 1137 Fset_window_buffer (selected_frame->minibuffer_window,
1138 XWINDOW (minibuf_window)->buffer); 1138 XWINDOW (minibuf_window)->buffer);
1139 minibuf_window = selected_screen->minibuffer_window; 1139 minibuf_window = selected_frame->minibuffer_window;
1140 } 1140 }
1141} 1141}
1142 1142
1143syms_of_screen () 1143syms_of_frame ()
1144{ 1144{
1145 Qscreenp = intern ("screenp"); 1145 Qframep = intern ("framep");
1146 Qlive_screen_p = intern ("live_screen_p"); 1146 Qlive_frame_p = intern ("live_frame_p");
1147 Qminibuffer = intern ("minibuffer"); 1147 Qminibuffer = intern ("minibuffer");
1148 1148
1149 staticpro (&Qscreenp); 1149 staticpro (&Qframep);
1150 staticpro (&Qlive_screen_p); 1150 staticpro (&Qlive_frame_p);
1151 staticpro (&Qminibuffer); 1151 staticpro (&Qminibuffer);
1152 1152
1153 staticpro (&Vscreen_list); 1153 staticpro (&Vframe_list);
1154 1154
1155 DEFVAR_LISP ("terminal-screen", &Vterminal_screen, 1155 DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
1156 "The initial screen-object, which represents Emacs's stdout."); 1156 "The initial frame-object, which represents Emacs's stdout.");
1157 1157
1158 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified, 1158 DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified,
1159 "Non-nil if all of emacs is iconified and screen updates are not needed."); 1159 "Non-nil if all of emacs is iconified and frame updates are not needed.");
1160 Vemacs_iconified = Qnil; 1160 Vemacs_iconified = Qnil;
1161 1161
1162 DEFVAR_LISP ("default-minibuffer-screen", &Vdefault_minibuffer_screen, 1162 DEFVAR_LISP ("default-minibuffer-frame", &Vdefault_minibuffer_frame,
1163 "Minibufferless screens use this screen's minibuffer.\n\ 1163 "Minibufferless frames use this frame's minibuffer.\n\
1164\n\ 1164\n\
1165Emacs cannot create minibufferless screens unless this is set to an\n\ 1165Emacs cannot create minibufferless frames unless this is set to an\n\
1166appropriate surrogate.\n\ 1166appropriate surrogate.\n\
1167\n\ 1167\n\
1168Emacs consults this variable only when creating minibufferless\n\ 1168Emacs consults this variable only when creating minibufferless\n\
1169screens; once the screen is created, it sticks with its assigned\n\ 1169frames; once the frame is created, it sticks with its assigned\n\
1170minibuffer, no matter what this variable is set to. This means that\n\ 1170minibuffer, no matter what this variable is set to. This means that\n\
1171this variable doesn't necessarily say anything meaningful about the\n\ 1171this variable doesn't necessarily say anything meaningful about the\n\
1172current set of screens, or where the minibuffer is currently being\n\ 1172current set of frames, or where the minibuffer is currently being\n\
1173displayed."); 1173displayed.");
1174 Vdefault_minibuffer_screen = Qnil; 1174 Vdefault_minibuffer_frame = Qnil;
1175 1175
1176 DEFVAR_LISP ("default-screen-alist", &Vdefault_screen_alist, 1176 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
1177 "Alist of default values for screen creation.\n\ 1177 "Alist of default values for frame creation.\n\
1178These may be set in your init file, like this:\n\ 1178These may be set in your init file, like this:\n\
1179 (setq default-screen-alist '((width . 80) (height . 55)))\n\ 1179 (setq default-frame-alist '((width . 80) (height . 55)))\n\
1180These override values given in window system configuration data, like\n\ 1180These override values given in window system configuration data, like\n\
1181X Windows' defaults database.\n\ 1181X Windows' defaults database.\n\
1182For values specific to the first Emacs screen, see `initial-screen-alist'.\n\ 1182For values specific to the first Emacs frame, see `initial-frame-alist'.\n\
1183For values specific to the separate minibuffer screen, see\n\ 1183For values specific to the separate minibuffer frame, see\n\
1184`minibuffer-screen-alist'."); 1184`minibuffer-frame-alist'.");
1185 Vdefault_screen_alist = Qnil; 1185 Vdefault_frame_alist = Qnil;
1186 1186
1187 defsubr (&Sscreenp); 1187 defsubr (&Sframep);
1188 defsubr (&Slive_screen_p); 1188 defsubr (&Slive_frame_p);
1189 defsubr (&Sselect_screen); 1189 defsubr (&Sselect_frame);
1190 defsubr (&Sselected_screen); 1190 defsubr (&Sselected_frame);
1191 defsubr (&Swindow_screen); 1191 defsubr (&Swindow_frame);
1192 defsubr (&Sscreen_root_window); 1192 defsubr (&Sframe_root_window);
1193 defsubr (&Sscreen_selected_window); 1193 defsubr (&Sframe_selected_window);
1194 defsubr (&Sscreen_list); 1194 defsubr (&Sframe_list);
1195 defsubr (&Snext_screen); 1195 defsubr (&Snext_frame);
1196 defsubr (&Sdelete_screen); 1196 defsubr (&Sdelete_frame);
1197 defsubr (&Smouse_position); 1197 defsubr (&Smouse_position);
1198 defsubr (&Sset_mouse_position); 1198 defsubr (&Sset_mouse_position);
1199#if 0 1199#if 0
1200 defsubr (&Sscreen_configuration); 1200 defsubr (&Sframe_configuration);
1201 defsubr (&Srestore_screen_configuration); 1201 defsubr (&Srestore_frame_configuration);
1202#endif 1202#endif
1203 defsubr (&Smake_screen_visible); 1203 defsubr (&Smake_frame_visible);
1204 defsubr (&Smake_screen_invisible); 1204 defsubr (&Smake_frame_invisible);
1205 defsubr (&Siconify_screen); 1205 defsubr (&Siconify_frame);
1206 defsubr (&Sscreen_visible_p); 1206 defsubr (&Sframe_visible_p);
1207 defsubr (&Svisible_screen_list); 1207 defsubr (&Svisible_frame_list);
1208 defsubr (&Sredirect_screen_focus); 1208 defsubr (&Sredirect_frame_focus);
1209 defsubr (&Sscreen_focus); 1209 defsubr (&Sframe_focus);
1210 defsubr (&Sscreen_parameters); 1210 defsubr (&Sframe_parameters);
1211 defsubr (&Smodify_screen_parameters); 1211 defsubr (&Smodify_frame_parameters);
1212 defsubr (&Sscreen_pixel_size); 1212 defsubr (&Sframe_pixel_size);
1213 defsubr (&Sscreen_height); 1213 defsubr (&Sframe_height);
1214 defsubr (&Sscreen_width); 1214 defsubr (&Sframe_width);
1215 defsubr (&Sset_screen_height); 1215 defsubr (&Sset_frame_height);
1216 defsubr (&Sset_screen_width); 1216 defsubr (&Sset_frame_width);
1217 defsubr (&Sset_screen_size); 1217 defsubr (&Sset_frame_size);
1218 defsubr (&Sset_screen_position); 1218 defsubr (&Sset_frame_position);
1219#ifndef HAVE_X11 1219#ifndef HAVE_X11
1220 defsubr (&Srubber_band_rectangle); 1220 defsubr (&Srubber_band_rectangle);
1221#endif /* HAVE_X11 */ 1221#endif /* HAVE_X11 */
diff --git a/src/frame.h b/src/frame.h
index f9e270e52c5..faf3000b2d2 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1,4 +1,4 @@
1/* Define screen-object for GNU Emacs. 1/* Define frame-object for GNU Emacs.
2 Copyright (C) 1988, 1992 Free Software Foundation, Inc. 2 Copyright (C) 1988, 1992 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
@@ -18,132 +18,132 @@ along with GNU Emacs; see the file COPYING. If not, write to
18the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ 18the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19 19
20 20
21/* The structure representing a screen. 21/* The structure representing a frame.
22 22
23 We declare this even if MULTI_SCREEN is not defined, because when 23 We declare this even if MULTI_FRAME is not defined, because when
24 we lack multi-screen support, we use one instance of this structure 24 we lack multi-frame support, we use one instance of this structure
25 to represent the one screen we support. This is cleaner than 25 to represent the one frame we support. This is cleaner than
26 having miscellaneous random variables scattered about. */ 26 having miscellaneous random variables scattered about. */
27 27
28enum output_method 28enum output_method
29{ output_termcap, output_x_window }; 29{ output_termcap, output_x_window };
30 30
31struct screen 31struct frame
32{ 32{
33 int size; 33 int size;
34 struct Lisp_Vector *next; 34 struct Lisp_Vector *next;
35 35
36 /* glyphs as they appear on the screen */ 36 /* glyphs as they appear on the frame */
37 struct screen_glyphs *current_glyphs; 37 struct frame_glyphs *current_glyphs;
38 38
39 /* glyphs we'd like to appear on the screen */ 39 /* glyphs we'd like to appear on the frame */
40 struct screen_glyphs *desired_glyphs; 40 struct frame_glyphs *desired_glyphs;
41 41
42 /* See do_line_insertion_deletion_costs for info on these arrays. */ 42 /* See do_line_insertion_deletion_costs for info on these arrays. */
43 /* Cost of inserting 1 line on this screen */ 43 /* Cost of inserting 1 line on this frame */
44 int *insert_line_cost; 44 int *insert_line_cost;
45 /* Cost of deleting 1 line on this screen */ 45 /* Cost of deleting 1 line on this frame */
46 int *delete_line_cost; 46 int *delete_line_cost;
47 /* Cost of inserting n lines on this screen */ 47 /* Cost of inserting n lines on this frame */
48 int *insert_n_lines_cost; 48 int *insert_n_lines_cost;
49 /* Cost of deleting n lines on this screen */ 49 /* Cost of deleting n lines on this frame */
50 int *delete_n_lines_cost; 50 int *delete_n_lines_cost;
51 51
52 /* glyphs for the mode line */ 52 /* glyphs for the mode line */
53 struct screen_glyphs *temp_glyphs; 53 struct frame_glyphs *temp_glyphs;
54 54
55 /* Intended cursor position of this screen. 55 /* Intended cursor position of this frame.
56 Measured in characters, counting from upper left corner 56 Measured in characters, counting from upper left corner
57 within the screen. */ 57 within the frame. */
58 int cursor_x; 58 int cursor_x;
59 int cursor_y; 59 int cursor_y;
60 60
61 /* Actual cursor position of this screen, and the character under it. 61 /* Actual cursor position of this frame, and the character under it.
62 (Not used for terminal screens.) */ 62 (Not used for terminal frames.) */
63 int phys_cursor_x; 63 int phys_cursor_x;
64 int phys_cursor_y; 64 int phys_cursor_y;
65 /* This is handy for undrawing the cursor, because current_glyphs is 65 /* This is handy for undrawing the cursor, because current_glyphs is
66 not always accurate when in do_scrolling. */ 66 not always accurate when in do_scrolling. */
67 GLYPH phys_cursor_glyph; 67 GLYPH phys_cursor_glyph;
68 68
69 /* Size of this screen, in units of characters. */ 69 /* Size of this frame, in units of characters. */
70 int height; 70 int height;
71 int width; 71 int width;
72 72
73 /* New height and width for pending size change. 0 if no change pending. */ 73 /* New height and width for pending size change. 0 if no change pending. */
74 int new_height, new_width; 74 int new_height, new_width;
75 75
76 /* Name of this screen: a Lisp string. */ 76 /* Name of this frame: a Lisp string. */
77 Lisp_Object name; 77 Lisp_Object name;
78 78
79 /* The screen which should recieve keystrokes that occur in this 79 /* The frame which should recieve keystrokes that occur in this
80 screen. This is usually the screen itself, but if the screen is 80 frame. This is usually the frame itself, but if the frame is
81 minibufferless, this points to the minibuffer screen when it is 81 minibufferless, this points to the minibuffer frame when it is
82 active. */ 82 active. */
83 Lisp_Object focus_screen; 83 Lisp_Object focus_frame;
84 84
85 /* This screen's root window. Every screen has one. 85 /* This frame's root window. Every frame has one.
86 If the screen has only a minibuffer window, this is it. 86 If the frame has only a minibuffer window, this is it.
87 Otherwise, if the screen has a minibuffer window, this is its sibling. */ 87 Otherwise, if the frame has a minibuffer window, this is its sibling. */
88 Lisp_Object root_window; 88 Lisp_Object root_window;
89 89
90 /* This screen's selected window. 90 /* This frame's selected window.
91 Each screen has its own window hierarchy 91 Each frame has its own window hierarchy
92 and one of the windows in it is selected within the screen. 92 and one of the windows in it is selected within the frame.
93 The selected window of the selected screen is Emacs's selected window. */ 93 The selected window of the selected frame is Emacs's selected window. */
94 Lisp_Object selected_window; 94 Lisp_Object selected_window;
95 95
96 /* This screen's minibuffer window. 96 /* This frame's minibuffer window.
97 Most screens have their own minibuffer windows, 97 Most frames have their own minibuffer windows,
98 but only the selected screen's minibuffer window 98 but only the selected frame's minibuffer window
99 can actually appear to exist. */ 99 can actually appear to exist. */
100 Lisp_Object minibuffer_window; 100 Lisp_Object minibuffer_window;
101 101
102 /* Parameter alist of this screen. 102 /* Parameter alist of this frame.
103 These are the parameters specified when creating the screen 103 These are the parameters specified when creating the frame
104 or modified with modify-screen-parameters. */ 104 or modified with modify-frame-parameters. */
105 Lisp_Object param_alist; 105 Lisp_Object param_alist;
106 106
107 /* The output method says how the contents of this screen 107 /* The output method says how the contents of this frame
108 are displayed. It could be using termcap, or using an X window. */ 108 are displayed. It could be using termcap, or using an X window. */
109 enum output_method output_method; 109 enum output_method output_method;
110 110
111 /* A structure of auxiliary data used for displaying the contents. 111 /* A structure of auxiliary data used for displaying the contents.
112 struct x_display is used for X window screens; 112 struct x_display is used for X window frames;
113 it is defined in xterm.h. */ 113 it is defined in xterm.h. */
114 union display { struct x_display *x; int nothing; } display; 114 union display { struct x_display *x; int nothing; } display;
115 115
116 /* Nonzero if last attempt at redisplay on this screen was preempted. */ 116 /* Nonzero if last attempt at redisplay on this frame was preempted. */
117 char display_preempted; 117 char display_preempted;
118 118
119 /* Nonzero if screen is currently displayed. */ 119 /* Nonzero if frame is currently displayed. */
120 char visible; 120 char visible;
121 121
122 /* Nonzero if window is currently iconified. 122 /* Nonzero if window is currently iconified.
123 This and visible are mutually exclusive. */ 123 This and visible are mutually exclusive. */
124 char iconified; 124 char iconified;
125 125
126 /* Nonzero if this screen should be redrawn. */ 126 /* Nonzero if this frame should be redrawn. */
127 char garbaged; 127 char garbaged;
128 128
129 /* True if screen actually has a minibuffer window on it. 129 /* True if frame actually has a minibuffer window on it.
130 0 if using a minibuffer window that isn't on this screen. */ 130 0 if using a minibuffer window that isn't on this frame. */
131 char has_minibuffer; 131 char has_minibuffer;
132 132
133 /* 0 means, if this screen has just one window, 133 /* 0 means, if this frame has just one window,
134 show no modeline for that window. */ 134 show no modeline for that window. */
135 char wants_modeline; 135 char wants_modeline;
136 136
137 /* Non-0 means raise this screen to the top of the heap when selected. */ 137 /* Non-0 means raise this frame to the top of the heap when selected. */
138 char auto_raise; 138 char auto_raise;
139 139
140 /* Non-0 means lower this screen to the bottom of the stack when left. */ 140 /* Non-0 means lower this frame to the bottom of the stack when left. */
141 char auto_lower; 141 char auto_lower;
142 142
143 /* True if screen's root window can't be split. */ 143 /* True if frame's root window can't be split. */
144 char no_split; 144 char no_split;
145 145
146 /* Storage for messages to this screen. */ 146 /* Storage for messages to this frame. */
147 char *message_buf; 147 char *message_buf;
148 148
149 /* Nonnegative if current redisplay should not do scroll computation 149 /* Nonnegative if current redisplay should not do scroll computation
@@ -151,162 +151,162 @@ struct screen
151 int scroll_bottom_vpos; 151 int scroll_bottom_vpos;
152}; 152};
153 153
154#ifdef MULTI_SCREEN 154#ifdef MULTI_FRAME
155 155
156typedef struct screen *SCREEN_PTR; 156typedef struct frame *FRAME_PTR;
157 157
158#define XSCREEN(p) ((struct screen *) XPNTR (p)) 158#define XFRAME(p) ((struct frame *) XPNTR (p))
159#define XSETSCREEN(p, v) ((struct screen *) XSETPNTR (p, v)) 159#define XSETFRAME(p, v) ((struct frame *) XSETPNTR (p, v))
160 160
161#define WINDOW_SCREEN(w) (w)->screen 161#define WINDOW_FRAME(w) (w)->frame
162 162
163#define SCREENP(s) (XTYPE(s) == Lisp_Screen) 163#define FRAMEP(f) (XTYPE(f) == Lisp_Frame)
164#define SCREEN_LIVE_P(s) ((s)->display.nothing != 0) 164#define FRAME_LIVE_P(f) ((f)->display.nothing != 0)
165#define SCREEN_IS_TERMCAP(s) ((s)->output_method == output_termcap) 165#define FRAME_IS_TERMCAP(f) ((f)->output_method == output_termcap)
166#define SCREEN_IS_X(s) ((s)->output_method == output_x_window) 166#define FRAME_IS_X(f) ((f)->output_method == output_x_window)
167#define SCREEN_MINIBUF_ONLY_P(s) \ 167#define FRAME_MINIBUF_ONLY_P(f) \
168 EQ (SCREEN_ROOT_WINDOW (s), SCREEN_MINIBUF_WINDOW (s)) 168 EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f))
169#define SCREEN_HAS_MINIBUF(s) ((s)->has_minibuffer) 169#define FRAME_HAS_MINIBUF(f) ((f)->has_minibuffer)
170#define SCREEN_CURRENT_GLYPHS(s) (s)->current_glyphs 170#define FRAME_CURRENT_GLYPHS(f) (f)->current_glyphs
171#define SCREEN_DESIRED_GLYPHS(s) (s)->desired_glyphs 171#define FRAME_DESIRED_GLYPHS(f) (f)->desired_glyphs
172#define SCREEN_TEMP_GLYPHS(s) (s)->temp_glyphs 172#define FRAME_TEMP_GLYPHS(f) (f)->temp_glyphs
173#define SCREEN_HEIGHT(s) (s)->height 173#define FRAME_HEIGHT(f) (f)->height
174#define SCREEN_WIDTH(s) (s)->width 174#define FRAME_WIDTH(f) (f)->width
175#define SCREEN_NEW_HEIGHT(s) (s)->new_height 175#define FRAME_NEW_HEIGHT(f) (f)->new_height
176#define SCREEN_NEW_WIDTH(s) (s)->new_width 176#define FRAME_NEW_WIDTH(f) (f)->new_width
177#define SCREEN_CURSOR_X(s) (s)->cursor_x 177#define FRAME_CURSOR_X(f) (f)->cursor_x
178#define SCREEN_CURSOR_Y(s) (s)->cursor_y 178#define FRAME_CURSOR_Y(f) (f)->cursor_y
179#define SCREEN_VISIBLE_P(s) (s)->visible 179#define FRAME_VISIBLE_P(f) (f)->visible
180#define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1, s->garbaged = 1) 180#define SET_FRAME_GARBAGED(f) (frame_garbaged = 1, f->garbaged = 1)
181#define SCREEN_GARBAGED_P(s) (s)->garbaged 181#define FRAME_GARBAGED_P(f) (f)->garbaged
182#define SCREEN_NO_SPLIT_P(s) (s)->no_split 182#define FRAME_NO_SPLIT_P(f) (f)->no_split
183#define SCREEN_WANTS_MODELINE_P(s) (s)->wants_modeline 183#define FRAME_WANTS_MODELINE_P(f) (f)->wants_modeline
184#define SCREEN_ICONIFIED_P(s) (s)->iconified 184#define FRAME_ICONIFIED_P(f) (f)->iconified
185#define SCREEN_MINIBUF_WINDOW(s) (s)->minibuffer_window 185#define FRAME_MINIBUF_WINDOW(f) (f)->minibuffer_window
186#define SCREEN_ROOT_WINDOW(s) (s)->root_window 186#define FRAME_ROOT_WINDOW(f) (f)->root_window
187#define SCREEN_SELECTED_WINDOW(s) (s)->selected_window 187#define FRAME_SELECTED_WINDOW(f) (f)->selected_window
188#define SET_GLYPHS_SCREEN(glyphs,screen) ((glyphs)->screen = (screen)) 188#define SET_GLYPHS_FRAME(glyphs,frame) ((glyphs)->frame = (frame))
189#define SCREEN_INSERT_COST(s) (s)->insert_line_cost 189#define FRAME_INSERT_COST(f) (f)->insert_line_cost
190#define SCREEN_DELETE_COST(s) (s)->delete_line_cost 190#define FRAME_DELETE_COST(f) (f)->delete_line_cost
191#define SCREEN_INSERTN_COST(s) (s)->insert_n_lines_cost 191#define FRAME_INSERTN_COST(f) (f)->insert_n_lines_cost
192#define SCREEN_DELETEN_COST(s) (s)->delete_n_lines_cost 192#define FRAME_DELETEN_COST(f) (f)->delete_n_lines_cost
193#define SCREEN_MESSAGE_BUF(s) (s)->message_buf 193#define FRAME_MESSAGE_BUF(f) (f)->message_buf
194#define SCREEN_SCROLL_BOTTOM_VPOS(s) (s)->scroll_bottom_vpos 194#define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos
195#define SCREEN_FOCUS_SCREEN(s) (s)->focus_screen 195#define FRAME_FOCUS_FRAME(f) (f)->focus_frame
196 196
197#define CHECK_SCREEN(x, i) \ 197#define CHECK_FRAME(x, i) \
198 { \ 198 { \
199 if (! SCREENP (x)) \ 199 if (! FRAMEP (x)) \
200 x = wrong_type_argument (Qscreenp, (x)); \ 200 x = wrong_type_argument (Qframep, (x)); \
201 } 201 }
202 202
203#define CHECK_LIVE_SCREEN(x, i) \ 203#define CHECK_LIVE_FRAME(x, i) \
204 { \ 204 { \
205 if (! SCREENP (x) \ 205 if (! FRAMEP (x) \
206 || ! SCREEN_LIVE_P (XSCREEN (x))) \ 206 || ! FRAME_LIVE_P (XFRAME (x))) \
207 x = wrong_type_argument (Qlive_screen_p, (x)); \ 207 x = wrong_type_argument (Qlive_frame_p, (x)); \
208 } 208 }
209 209
210/* FOR_EACH_SCREEN (LIST_VAR, SCREEN_VAR) followed by a statement is a 210/* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
211 `for' loop which iterates over the elements of Vscreen_list. The 211 `for' loop which iterates over the elements of Vframe_list. The
212 loop will set SCREEN_VAR, a SCREEN_PTR, to each screen in 212 loop will set FRAME_VAR, a FRAME_PTR, to each frame in
213 Vscreen_list in succession and execute the statement. LIST_VAR 213 Vframe_list in succession and execute the statement. LIST_VAR
214 should be a Lisp_Object; it is used to iterate through the 214 should be a Lisp_Object; it is used to iterate through the
215 Vscreen_list. 215 Vframe_list.
216 216
217 If MULTI_SCREEN isn't defined, then this loop expands to something which 217 If MULTI_FRAME isn't defined, then this loop expands to something which
218 executes the statement once. */ 218 executes the statement once. */
219#define FOR_EACH_SCREEN(list_var, screen_var) \ 219#define FOR_EACH_FRAME(list_var, frame_var) \
220 for ((list_var) = Vscreen_list; \ 220 for ((list_var) = Vframe_list; \
221 (CONSP (list_var) \ 221 (CONSP (list_var) \
222 && (screen_var = XSCREEN (XCONS (list_var)->car), 1)); \ 222 && (frame_var = XFRAME (XCONS (list_var)->car), 1)); \
223 list_var = XCONS (list_var)->cdr) 223 list_var = XCONS (list_var)->cdr)
224 224
225 225
226extern Lisp_Object Qscreenp, Qlive_screen_p; 226extern Lisp_Object Qframep, Qlive_frame_p;
227 227
228extern struct screen *selected_screen; 228extern struct frame *selected_frame;
229extern struct screen *last_nonminibuf_screen; 229extern struct frame *last_nonminibuf_frame;
230 230
231extern struct screen *make_terminal_screen (); 231extern struct frame *make_terminal_frame ();
232extern struct screen *make_screen (); 232extern struct frame *make_frame ();
233extern struct screen *make_minibuffer_screen (); 233extern struct frame *make_minibuffer_frame ();
234extern struct screen *make_screen_without_minibuffer (); 234extern struct frame *make_frame_without_minibuffer ();
235 235
236/* Nonzero means SCREEN_MESSAGE_BUF (selected_screen) is being used by 236/* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by
237 print. */ 237 print. */
238extern int message_buf_print; 238extern int message_buf_print;
239 239
240extern Lisp_Object Vscreen_list; 240extern Lisp_Object Vframe_list;
241extern Lisp_Object Vdefault_screen_alist; 241extern Lisp_Object Vdefault_frame_alist;
242 242
243extern Lisp_Object Vterminal_screen; 243extern Lisp_Object Vterminal_frame;
244 244
245#else /* not MULTI_SCREEN */ 245#else /* not MULTI_FRAME */
246 246
247/* These definitions are used in a single-screen version of Emacs. */ 247/* These definitions are used in a single-frame version of Emacs. */
248 248
249#define SCREEN_PTR int 249#define FRAME_PTR int
250 250
251extern struct screen the_only_screen; 251extern struct frame the_only_frame;
252 252
253extern int selected_screen; 253extern int selected_frame;
254extern int last_nonminibuf_screen; 254extern int last_nonminibuf_frame;
255 255
256/* Nonzero means SCREEN_MESSAGE_BUF (selected_screen) is being used by 256/* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by
257 print. */ 257 print. */
258extern int message_buf_print; 258extern int message_buf_print;
259 259
260#define XSCREEN(s) selected_screen 260#define XFRAME(f) selected_frame
261#define WINDOW_SCREEN(w) selected_screen 261#define WINDOW_FRAME(w) selected_frame
262 262
263#define SCREENP(s) (XTYPE(s) == Lisp_Screen) 263#define FRAMEP(f) (XTYPE(f) == Lisp_Frame)
264#define SCREEN_LIVE_P(s) 1 264#define FRAME_LIVE_P(f) 1
265#define SCREEN_IS_TERMCAP(s) 1 265#define FRAME_IS_TERMCAP(f) 1
266#define SCREEN_IS_X(s) 0 266#define FRAME_IS_X(f) 0
267#define SCREEN_MINIBUF_ONLY_P(s) 0 267#define FRAME_MINIBUF_ONLY_P(f) 0
268#define SCREEN_HAS_MINIBUF(s) 1 268#define FRAME_HAS_MINIBUF(f) 1
269#define SCREEN_CURRENT_GLYPHS(s) the_only_screen.current_glyphs 269#define FRAME_CURRENT_GLYPHS(f) the_only_frame.current_glyphs
270#define SCREEN_DESIRED_GLYPHS(s) the_only_screen.desired_glyphs 270#define FRAME_DESIRED_GLYPHS(f) the_only_frame.desired_glyphs
271#define SCREEN_TEMP_GLYPHS(s) the_only_screen.temp_glyphs 271#define FRAME_TEMP_GLYPHS(f) the_only_frame.temp_glyphs
272#define SCREEN_HEIGHT(s) the_only_screen.height 272#define FRAME_HEIGHT(f) the_only_frame.height
273#define SCREEN_WIDTH(s) the_only_screen.width 273#define FRAME_WIDTH(f) the_only_frame.width
274#define SCREEN_NEW_HEIGHT(s) the_only_screen.new_height 274#define FRAME_NEW_HEIGHT(f) the_only_frame.new_height
275#define SCREEN_NEW_WIDTH(s) the_only_screen.new_width 275#define FRAME_NEW_WIDTH(f) the_only_frame.new_width
276#define SCREEN_CURSOR_X(s) the_only_screen.cursor_x 276#define FRAME_CURSOR_X(f) the_only_frame.cursor_x
277#define SCREEN_CURSOR_Y(s) the_only_screen.cursor_y 277#define FRAME_CURSOR_Y(f) the_only_frame.cursor_y
278#define SCREEN_VISIBLE_P(s) 1 278#define FRAME_VISIBLE_P(f) 1
279#define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1) 279#define SET_FRAME_GARBAGED(f) (frame_garbaged = 1)
280#define SCREEN_GARBAGED_P(s) screen_garbaged 280#define FRAME_GARBAGED_P(f) frame_garbaged
281#define SCREEN_NO_SPLIT_P(s) 0 281#define FRAME_NO_SPLIT_P(f) 0
282#define SCREEN_WANTS_MODELINE_P(s) 1 282#define FRAME_WANTS_MODELINE_P(f) 1
283#define SCREEN_ICONIFIED_P(s) 0 283#define FRAME_ICONIFIED_P(f) 0
284#define SCREEN_MINIBUF_WINDOW(s) minibuf_window 284#define FRAME_MINIBUF_WINDOW(f) minibuf_window
285#define SCREEN_ROOT_WINDOW(s) the_only_screen.root_window 285#define FRAME_ROOT_WINDOW(f) the_only_frame.root_window
286#define SCREEN_SELECTED_WINDOW(s) selected_window 286#define FRAME_SELECTED_WINDOW(f) selected_window
287#define SET_GLYPHS_SCREEN(glyphs,screen) 287#define SET_GLYPHS_FRAME(glyphs,frame)
288#define SCREEN_INSERT_COST(screen) the_only_screen.insert_line_cost 288#define FRAME_INSERT_COST(frame) the_only_frame.insert_line_cost
289#define SCREEN_DELETE_COST(screen) the_only_screen.delete_line_cost 289#define FRAME_DELETE_COST(frame) the_only_frame.delete_line_cost
290#define SCREEN_INSERTN_COST(screen) the_only_screen.insert_n_lines_cost 290#define FRAME_INSERTN_COST(frame) the_only_frame.insert_n_lines_cost
291#define SCREEN_DELETEN_COST(screen) the_only_screen.delete_n_lines_cost 291#define FRAME_DELETEN_COST(frame) the_only_frame.delete_n_lines_cost
292#define SCREEN_MESSAGE_BUF(s) the_only_screen.message_buf 292#define FRAME_MESSAGE_BUF(f) the_only_frame.message_buf
293#define SCREEN_SCROLL_BOTTOM_VPOS(s) the_only_screen.scroll_bottom_vpos 293#define FRAME_SCROLL_BOTTOM_VPOS(f) the_only_frame.scroll_bottom_vpos
294#define SCREEN_FOCUS_SCREEN(s) 0 294#define FRAME_FOCUS_FRAME(f) 0
295 295
296#define CHECK_SCREEN(x, i) { ; } 296#define CHECK_FRAME(x, i) { ; }
297#define CHECK_LIVE_SCREEN(x, y) { ; } 297#define CHECK_LIVE_FRAME(x, y) { ; }
298 298
299/* FOR_EACH_SCREEN (LIST_VAR, SCREEN_VAR) followed by a statement is a 299/* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
300 `for' loop which iterates over the elements of Vscreen_list. The 300 `for' loop which iterates over the elements of Vframe_list. The
301 loop will set SCREEN_VAR, a SCREEN_PTR, to each screen in 301 loop will set FRAME_VAR, a FRAME_PTR, to each frame in
302 Vscreen_list in succession and execute the statement. LIST_VAR 302 Vframe_list in succession and execute the statement. LIST_VAR
303 should be a Lisp_Object; it is used to iterate through the 303 should be a Lisp_Object; it is used to iterate through the
304 Vscreen_list. 304 Vframe_list.
305 305
306 If MULTI_SCREEN _is_ defined, then this loop expands to a real 306 If MULTI_FRAME _is_ defined, then this loop expands to a real
307 `for' loop which traverses Vscreen_list using LIST_VAR and 307 `for' loop which traverses Vframe_list using LIST_VAR and
308 SCREEN_VAR. */ 308 FRAME_VAR. */
309#define FOR_EACH_SCREEN(list_var, screen_var) \ 309#define FOR_EACH_FRAME(list_var, frame_var) \
310 for (screen_var = (SCREEN_PTR) 1; screen_var; screen_var = (SCREEN_PTR) 0) 310 for (frame_var = (FRAME_PTR) 1; frame_var; frame_var = (FRAME_PTR) 0)
311 311
312#endif /* not MULTI_SCREEN */ 312#endif /* not MULTI_FRAME */
diff --git a/src/keyboard.c b/src/keyboard.c
index cb2e56adf36..442a4f318ea 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -28,7 +28,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
28#include "lisp.h" 28#include "lisp.h"
29#include "termhooks.h" 29#include "termhooks.h"
30#include "macros.h" 30#include "macros.h"
31#include "screen.h" 31#include "frame.h"
32#include "window.h" 32#include "window.h"
33#include "commands.h" 33#include "commands.h"
34#include "buffer.h" 34#include "buffer.h"
@@ -191,24 +191,24 @@ extern Lisp_Object Vmouse_event;
191/* Hook to call on each mouse event after running its definition. */ 191/* Hook to call on each mouse event after running its definition. */
192Lisp_Object Vmouse_event_function; 192Lisp_Object Vmouse_event_function;
193 193
194/* Hook to call when mouse leaves screen. */ 194/* Hook to call when mouse leaves frame. */
195Lisp_Object Vmouse_left_hook; 195Lisp_Object Vmouse_left_hook;
196 196
197/* Hook to call when a screen is mapped. */ 197/* Hook to call when a frame is mapped. */
198Lisp_Object Vmap_screen_hook; 198Lisp_Object Vmap_frame_hook;
199 199
200/* Hook to call when a screen is unmapped. */ 200/* Hook to call when a frame is unmapped. */
201Lisp_Object Vunmap_screen_hook; 201Lisp_Object Vunmap_frame_hook;
202 202
203/* Handler for non-grabbed (no keys depressed) mouse motion. */ 203/* Handler for non-grabbed (no keys depressed) mouse motion. */
204Lisp_Object Vmouse_motion_handler; 204Lisp_Object Vmouse_motion_handler;
205 205
206/* The screen in which the last input event occurred. 206/* The frame in which the last input event occurred.
207 command_loop_1 will select this screen before running the 207 command_loop_1 will select this frame before running the
208 command bound to an event sequence, and read_key_sequence will 208 command bound to an event sequence, and read_key_sequence will
209 toss the existing prefix if the user starts typing at a 209 toss the existing prefix if the user starts typing at a
210 new screen. */ 210 new frame. */
211Lisp_Object Vlast_event_screen; 211Lisp_Object Vlast_event_frame;
212 212
213/* The timestamp of the last input event we received from the X server. 213/* The timestamp of the last input event we received from the X server.
214 X Windows wants this for selection ownership. */ 214 X Windows wants this for selection ownership. */
@@ -494,7 +494,7 @@ echo_length ()
494 494
495/* Truncate the current echo message to its first LEN chars. 495/* Truncate the current echo message to its first LEN chars.
496 This and echo_char get used by read_key_sequence when the user 496 This and echo_char get used by read_key_sequence when the user
497 switches screens while entering a key sequence. */ 497 switches frames while entering a key sequence. */
498 498
499static void 499static void
500echo_truncate (len) 500echo_truncate (len)
@@ -600,10 +600,10 @@ cmd_error (data)
600 Vexecuting_macro = Qnil; 600 Vexecuting_macro = Qnil;
601 echo_area_glyphs = 0; 601 echo_area_glyphs = 0;
602 602
603 /* If the window system or terminal screen hasn't been initialized 603 /* If the window system or terminal frame hasn't been initialized
604 yet, or we're not interactive, it's best to dump this message out 604 yet, or we're not interactive, it's best to dump this message out
605 to stderr and exit. */ 605 to stderr and exit. */
606 if (! SCREEN_MESSAGE_BUF (selected_screen) 606 if (! FRAME_MESSAGE_BUF (selected_frame)
607 || noninteractive) 607 || noninteractive)
608 stream = Qexternal_debugging_output; 608 stream = Qexternal_debugging_output;
609 else 609 else
@@ -657,9 +657,9 @@ cmd_error (data)
657 } 657 }
658 UNGCPRO; 658 UNGCPRO;
659 659
660 /* If the window system or terminal screen hasn't been initialized 660 /* If the window system or terminal frame hasn't been initialized
661 yet, or we're in -batch mode, this error should cause Emacs to exit. */ 661 yet, or we're in -batch mode, this error should cause Emacs to exit. */
662 if (! SCREEN_MESSAGE_BUF (selected_screen) 662 if (! FRAME_MESSAGE_BUF (selected_frame)
663 || noninteractive) 663 || noninteractive)
664 { 664 {
665 Fterpri (stream); 665 Fterpri (stream);
@@ -836,11 +836,11 @@ command_loop_1 ()
836 836
837 ++num_input_keys; 837 ++num_input_keys;
838 838
839#ifdef MULTI_SCREEN 839#ifdef MULTI_FRAME
840 /* Select the screen that the key sequence came from. */ 840 /* Select the frame that the key sequence came from. */
841 if (XTYPE (Vlast_event_screen) == Lisp_Screen 841 if (XTYPE (Vlast_event_frame) == Lisp_Frame
842 && XSCREEN (Vlast_event_screen) != selected_screen) 842 && XFRAME (Vlast_event_frame) != selected_frame)
843 Fselect_screen (Vlast_event_screen, Qnil); 843 Fselect_frame (Vlast_event_frame, Qnil);
844#endif 844#endif
845 845
846 /* Now we have read a key sequence of length I, 846 /* Now we have read a key sequence of length I,
@@ -851,7 +851,7 @@ command_loop_1 ()
851 851
852#if 0 852#if 0
853#ifdef HAVE_X_WINDOWS 853#ifdef HAVE_X_WINDOWS
854 if (SCREEN_IS_X (selected_screen)) 854 if (FRAME_IS_X (selected_frame))
855 { 855 {
856 if (i == -1) /* Mouse event */ 856 if (i == -1) /* Mouse event */
857 { 857 {
@@ -1159,8 +1159,8 @@ read_char (commandflag)
1159 if (_setjmp (getcjmp)) 1159 if (_setjmp (getcjmp))
1160 { 1160 {
1161 XSET (c, Lisp_Int, quit_char); 1161 XSET (c, Lisp_Int, quit_char);
1162#ifdef MULTI_SCREEN 1162#ifdef MULTI_FRAME
1163 XSET (Vlast_event_screen, Lisp_Screen, selected_screen); 1163 XSET (Vlast_event_frame, Lisp_Frame, selected_frame);
1164#endif 1164#endif
1165 1165
1166 goto non_reread; 1166 goto non_reread;
@@ -1345,7 +1345,7 @@ read_char (commandflag)
1345 1345
1346 cancel_echoing (); 1346 cancel_echoing ();
1347 c = read_char (0); 1347 c = read_char (0);
1348 /* Remove the help from the screen */ 1348 /* Remove the help from the frame */
1349 unbind_to (count, Qnil); 1349 unbind_to (count, Qnil);
1350 redisplay (); 1350 redisplay ();
1351 if (EQ (c, make_number (040))) 1351 if (EQ (c, make_number (040)))
@@ -1393,7 +1393,7 @@ restore_getcjmp (temp)
1393/* Set this for debugging, to have a way to get out */ 1393/* Set this for debugging, to have a way to get out */
1394int stop_character; 1394int stop_character;
1395 1395
1396extern int screen_garbaged; 1396extern int frame_garbaged;
1397 1397
1398/* Return true iff there are any events in the queue that read-char 1398/* Return true iff there are any events in the queue that read-char
1399 would return. If this returns false, a read-char would block. */ 1399 would return. If this returns false, a read-char would block. */
@@ -1487,11 +1487,11 @@ kbd_buffer_store_event (event)
1487 || ((c == (0200 | quit_char)) && !meta_key)) 1487 || ((c == (0200 | quit_char)) && !meta_key))
1488 { 1488 {
1489 /* If this results in a quit_char being returned to Emacs as 1489 /* If this results in a quit_char being returned to Emacs as
1490 input, set last-event-screen properly. If this doesn't 1490 input, set last-event-frame properly. If this doesn't
1491 get returned to Emacs as an event, the next event read 1491 get returned to Emacs as an event, the next event read
1492 will set Vlast_event_screen again, so this is safe to do. */ 1492 will set Vlast_event_frame again, so this is safe to do. */
1493 extern SIGTYPE interrupt_signal (); 1493 extern SIGTYPE interrupt_signal ();
1494 Vlast_event_screen = SCREEN_FOCUS_SCREEN (event->screen); 1494 Vlast_event_frame = FRAME_FOCUS_FRAME (event->frame);
1495 last_event_timestamp = event->timestamp; 1495 last_event_timestamp = event->timestamp;
1496 interrupt_signal (); 1496 interrupt_signal ();
1497 return; 1497 return;
@@ -1518,7 +1518,7 @@ kbd_buffer_store_event (event)
1518 kbd_store_ptr->kind = event->kind; 1518 kbd_store_ptr->kind = event->kind;
1519 kbd_store_ptr->code = event->code; 1519 kbd_store_ptr->code = event->code;
1520 kbd_store_ptr->part = event->part; 1520 kbd_store_ptr->part = event->part;
1521 kbd_store_ptr->screen = event->screen; 1521 kbd_store_ptr->frame = event->frame;
1522 kbd_store_ptr->modifiers = event->modifiers; 1522 kbd_store_ptr->modifiers = event->modifiers;
1523 kbd_store_ptr->x = event->x; 1523 kbd_store_ptr->x = event->x;
1524 kbd_store_ptr->y = event->y; 1524 kbd_store_ptr->y = event->y;
@@ -1610,11 +1610,11 @@ kbd_buffer_get_event ()
1610 { 1610 {
1611 if (kbd_fetch_ptr == kbd_buffer + KBD_BUFFER_SIZE) 1611 if (kbd_fetch_ptr == kbd_buffer + KBD_BUFFER_SIZE)
1612 kbd_fetch_ptr = kbd_buffer; 1612 kbd_fetch_ptr = kbd_buffer;
1613 /* Do the redirection specified by the focus_screen 1613 /* Do the redirection specified by the focus_frame
1614 member now, before we return this event. */ 1614 member now, before we return this event. */
1615 kbd_fetch_ptr->screen = 1615 kbd_fetch_ptr->frame =
1616 XSCREEN (SCREEN_FOCUS_SCREEN (kbd_fetch_ptr->screen)); 1616 XFRAME (FRAME_FOCUS_FRAME (kbd_fetch_ptr->frame));
1617 XSET (Vlast_event_screen, Lisp_Screen, kbd_fetch_ptr->screen); 1617 XSET (Vlast_event_frame, Lisp_Frame, kbd_fetch_ptr->frame);
1618 last_event_timestamp = kbd_fetch_ptr->timestamp; 1618 last_event_timestamp = kbd_fetch_ptr->timestamp;
1619 obj = make_lispy_event (kbd_fetch_ptr); 1619 obj = make_lispy_event (kbd_fetch_ptr);
1620 kbd_fetch_ptr->kind = no_event; 1620 kbd_fetch_ptr->kind = no_event;
@@ -1624,14 +1624,14 @@ kbd_buffer_get_event ()
1624 } 1624 }
1625 else if (do_mouse_tracking && mouse_moved) 1625 else if (do_mouse_tracking && mouse_moved)
1626 { 1626 {
1627 SCREEN_PTR screen; 1627 FRAME_PTR frame;
1628 Lisp_Object x, y; 1628 Lisp_Object x, y;
1629 unsigned long time; 1629 unsigned long time;
1630 1630
1631 (*mouse_position_hook) (&screen, &x, &y, &time); 1631 (*mouse_position_hook) (&frame, &x, &y, &time);
1632 XSET (Vlast_event_screen, Lisp_Screen, screen); 1632 XSET (Vlast_event_frame, Lisp_Frame, frame);
1633 1633
1634 obj = make_lispy_movement (screen, x, y, time); 1634 obj = make_lispy_movement (frame, x, y, time);
1635 } 1635 }
1636 else 1636 else
1637 /* We were promised by the above while loop that there was 1637 /* We were promised by the above while loop that there was
@@ -1763,7 +1763,7 @@ make_lispy_event (event)
1763 { 1763 {
1764 int part; 1764 int part;
1765 Lisp_Object window = 1765 Lisp_Object window =
1766 window_from_coordinates (event->screen, 1766 window_from_coordinates (event->frame,
1767 XINT (event->x), XINT (event->y), 1767 XINT (event->x), XINT (event->y),
1768 &part); 1768 &part);
1769 Lisp_Object posn; 1769 Lisp_Object posn;
@@ -1814,7 +1814,7 @@ make_lispy_event (event)
1814 (sizeof (lispy_mouse_names) 1814 (sizeof (lispy_mouse_names)
1815 / sizeof (lispy_mouse_names[0]))); 1815 / sizeof (lispy_mouse_names[0])));
1816 return Fcons (event->part, 1816 return Fcons (event->part,
1817 Fcons (SCREEN_SELECTED_WINDOW (event->screen), 1817 Fcons (FRAME_SELECTED_WINDOW (event->frame),
1818 Fcons (button, 1818 Fcons (button,
1819 Fcons (Fcons (event->x, event->y), 1819 Fcons (Fcons (event->x, event->y),
1820 Fcons (make_number 1820 Fcons (make_number
@@ -1829,8 +1829,8 @@ make_lispy_event (event)
1829} 1829}
1830 1830
1831static Lisp_Object 1831static Lisp_Object
1832make_lispy_movement (screen, x, y, time) 1832make_lispy_movement (frame, x, y, time)
1833 SCREEN_PTR screen; 1833 FRAME_PTR frame;
1834 Lisp_Object x, y; 1834 Lisp_Object x, y;
1835 unsigned long time; 1835 unsigned long time;
1836{ 1836{
@@ -1841,8 +1841,8 @@ make_lispy_movement (screen, x, y, time)
1841 1841
1842 ix = XINT (x); 1842 ix = XINT (x);
1843 iy = XINT (y); 1843 iy = XINT (y);
1844 window = (screen 1844 window = (frame
1845 ? window_from_coordinates (screen, ix, iy, &part) 1845 ? window_from_coordinates (frame, ix, iy, &part)
1846 : Qnil); 1846 : Qnil);
1847 if (XTYPE (window) != Lisp_Window) 1847 if (XTYPE (window) != Lisp_Window)
1848 posn = Qnil; 1848 posn = Qnil;
@@ -2207,7 +2207,7 @@ read_avail_input (expected)
2207 { 2207 {
2208 buf[i].kind = ascii_keystroke; 2208 buf[i].kind = ascii_keystroke;
2209 XSET (buf[i].code, Lisp_Int, cbuf[i]); 2209 XSET (buf[i].code, Lisp_Int, cbuf[i]);
2210 buf[i].screen = selected_screen; 2210 buf[i].frame = selected_frame;
2211 } 2211 }
2212 } 2212 }
2213 2213
@@ -2309,7 +2309,7 @@ read_char_menu_prompt (prompt, local, global)
2309 register Lisp_Object rest, name; 2309 register Lisp_Object rest, name;
2310 Lisp_Object hmap; 2310 Lisp_Object hmap;
2311 int nlength; 2311 int nlength;
2312 int width = SCREEN_WIDTH (selected_screen) - 4; 2312 int width = FRAME_WIDTH (selected_frame) - 4;
2313 char *menu = (char *) alloca (width); 2313 char *menu = (char *) alloca (width);
2314 2314
2315 /* Use local over global Menu maps */ 2315 /* Use local over global Menu maps */
@@ -2515,7 +2515,7 @@ follow_key (key, nmaps, current, defs, next)
2515 with PROMPT. Echo starting immediately unless `prompt' is 0. 2515 with PROMPT. Echo starting immediately unless `prompt' is 0.
2516 Return the length of the key sequence stored. 2516 Return the length of the key sequence stored.
2517 2517
2518 If the user switches screens in the midst of a key sequence, we 2518 If the user switches frames in the midst of a key sequence, we
2519 throw away any prefix we have read so far, and start afresh. For 2519 throw away any prefix we have read so far, and start afresh. For
2520 mouse clicks, we look up the click in the keymap of the buffer 2520 mouse clicks, we look up the click in the keymap of the buffer
2521 clicked on, throwing away any prefix if it is not the same buffer 2521 clicked on, throwing away any prefix if it is not the same buffer
@@ -2532,7 +2532,7 @@ read_key_sequence (keybuf, bufsize, prompt)
2532 2532
2533 /* The buffer that the most recently read event was typed at. This 2533 /* The buffer that the most recently read event was typed at. This
2534 helps us read mouse clicks according to the buffer clicked in, 2534 helps us read mouse clicks according to the buffer clicked in,
2535 and notice when the mouse has moved from one screen to another. */ 2535 and notice when the mouse has moved from one frame to another. */
2536 struct buffer *last_event_buffer = current_buffer; 2536 struct buffer *last_event_buffer = current_buffer;
2537 2537
2538 /* The length of the echo buffer when we started reading, and 2538 /* The length of the echo buffer when we started reading, and
@@ -2639,13 +2639,13 @@ read_key_sequence (keybuf, bufsize, prompt)
2639 2639
2640 Vquit_flag = Qnil; 2640 Vquit_flag = Qnil;
2641 2641
2642#ifdef MULTI_SCREEN 2642#ifdef MULTI_FRAME
2643 /* What buffer was this event typed/moused at? */ 2643 /* What buffer was this event typed/moused at? */
2644 if (XTYPE (key) == Lisp_Int || XTYPE (key) == Lisp_Symbol) 2644 if (XTYPE (key) == Lisp_Int || XTYPE (key) == Lisp_Symbol)
2645 buf = (XBUFFER 2645 buf = (XBUFFER
2646 (XWINDOW 2646 (XWINDOW
2647 (SCREEN_SELECTED_WINDOW 2647 (FRAME_SELECTED_WINDOW
2648 (XSCREEN (Vlast_event_screen)))->buffer)); 2648 (XFRAME (Vlast_event_frame)))->buffer));
2649 else if (EVENT_HAS_PARAMETERS (key)) 2649 else if (EVENT_HAS_PARAMETERS (key))
2650 { 2650 {
2651 Lisp_Object window = EVENT_WINDOW (key); 2651 Lisp_Object window = EVENT_WINDOW (key);
@@ -2664,7 +2664,7 @@ read_key_sequence (keybuf, bufsize, prompt)
2664 if (buf != last_event_buffer) 2664 if (buf != last_event_buffer)
2665 { 2665 {
2666 last_event_buffer = buf; 2666 last_event_buffer = buf;
2667 Fselect_screen (Vlast_event_screen, Qnil); 2667 Fselect_frame (Vlast_event_frame, Qnil);
2668 2668
2669 /* Arrange to read key as the next event. */ 2669 /* Arrange to read key as the next event. */
2670 keybuf[0] = key; 2670 keybuf[0] = key;
@@ -2753,7 +2753,7 @@ First arg PROMPT is a prompt string. If nil, do not prompt specially.\n\
2753Second (optional) arg CONTINUE-ECHO, if non-nil, means this key echos\n\ 2753Second (optional) arg CONTINUE-ECHO, if non-nil, means this key echos\n\
2754as a continuation of the previous key.\n\ 2754as a continuation of the previous key.\n\
2755\n\ 2755\n\
2756If Emacs is running on multiple screens, switching between screens in\n\ 2756If Emacs is running on multiple frames, switching between frames in\n\
2757the midst of a keystroke will toss any prefix typed so far. A C-g\n\ 2757the midst of a keystroke will toss any prefix typed so far. A C-g\n\
2758typed while in this function is treated like any other character, and\n\ 2758typed while in this function is treated like any other character, and\n\
2759`quit-flag' is not set.") 2759`quit-flag' is not set.")
@@ -2864,7 +2864,7 @@ with EVENT as arg.")
2864{ 2864{
2865 Lisp_Object tem; 2865 Lisp_Object tem;
2866 Lisp_Object mouse_cmd; 2866 Lisp_Object mouse_cmd;
2867 Lisp_Object keyseq, window, screen_part, pos, time; 2867 Lisp_Object keyseq, window, frame_part, pos, time;
2868 2868
2869#ifndef HAVE_X11 2869#ifndef HAVE_X11
2870 Vmouse_event = event; 2870 Vmouse_event = event;
@@ -2879,7 +2879,7 @@ with EVENT as arg.")
2879 CHECK_CONS (event, 0); 2879 CHECK_CONS (event, 0);
2880 pos = Fcar (event); 2880 pos = Fcar (event);
2881 window = Fcar (Fcdr (event)); 2881 window = Fcar (Fcdr (event));
2882 screen_part = Fcar (Fcdr (Fcdr (event))); 2882 frame_part = Fcar (Fcdr (Fcdr (event)));
2883 keyseq = Fcar (Fcdr (Fcdr (Fcdr (event)))); 2883 keyseq = Fcar (Fcdr (Fcdr (Fcdr (event))));
2884 time = Fcar (Fcdr (Fcdr (Fcdr (Fcdr (event))))); 2884 time = Fcar (Fcdr (Fcdr (Fcdr (Fcdr (event)))));
2885 CHECK_STRING (keyseq, 0); 2885 CHECK_STRING (keyseq, 0);
@@ -2921,14 +2921,14 @@ with EVENT as arg.")
2921 } 2921 }
2922 else 2922 else
2923 { 2923 {
2924 SCREEN_PTR s = XSCREEN (WINDOW_SCREEN (XWINDOW (window))); 2924 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
2925 2925
2926#ifndef HAVE_X11 2926#ifndef HAVE_X11
2927 Vmouse_window = s->selected_window; 2927 Vmouse_window = f->selected_window;
2928#endif /* HAVE_X11 */ 2928#endif /* HAVE_X11 */
2929 /* It's defined; call the definition. */ 2929 /* It's defined; call the definition. */
2930 Vprefix_arg = Qnil; 2930 Vprefix_arg = Qnil;
2931 if (!NILP (screen_part)) 2931 if (!NILP (frame_part))
2932 { 2932 {
2933 /* For a scroll-bar click, set the prefix arg 2933 /* For a scroll-bar click, set the prefix arg
2934 to the number of lines down from the top the click was. 2934 to the number of lines down from the top the click was.
@@ -2943,7 +2943,7 @@ with EVENT as arg.")
2943 2943
2944 if (XINT (length) != 0) 2944 if (XINT (length) != 0)
2945 XSET (Vprefix_arg, Lisp_Int, 2945 XSET (Vprefix_arg, Lisp_Int,
2946 (SCREEN_HEIGHT (s) * (XINT (position) + XINT (offset)) 2946 (FRAME_HEIGHT (f) * (XINT (position) + XINT (offset))
2947 / (XINT (length) + 2 * XINT (offset)))); 2947 / (XINT (length) + 2 * XINT (offset))));
2948 } 2948 }
2949 Fcommand_execute (mouse_cmd, Qnil); 2949 Fcommand_execute (mouse_cmd, Qnil);
@@ -3167,7 +3167,7 @@ On such systems, Emacs will start a subshell and wait for it to exit.")
3167 if (!EQ (tem, Qnil)) return Qnil; 3167 if (!EQ (tem, Qnil)) return Qnil;
3168 } 3168 }
3169 3169
3170 get_screen_size (&old_width, &old_height); 3170 get_frame_size (&old_width, &old_height);
3171 reset_sys_modes (); 3171 reset_sys_modes ();
3172 /* sys_suspend can get an error if it tries to fork a subshell 3172 /* sys_suspend can get an error if it tries to fork a subshell
3173 and the system resources aren't available for that. */ 3173 and the system resources aren't available for that. */
@@ -3179,9 +3179,9 @@ On such systems, Emacs will start a subshell and wait for it to exit.")
3179 /* Check if terminal/window size has changed. 3179 /* Check if terminal/window size has changed.
3180 Note that this is not useful when we are running directly 3180 Note that this is not useful when we are running directly
3181 with a window system; but suspend should be disabled in that case. */ 3181 with a window system; but suspend should be disabled in that case. */
3182 get_screen_size (&width, &height); 3182 get_frame_size (&width, &height);
3183 if (width != old_width || height != old_height) 3183 if (width != old_width || height != old_height)
3184 change_screen_size (height, width, 0); 3184 change_frame_size (height, width, 0);
3185 3185
3186 /* Call value of suspend-resume-hook 3186 /* Call value of suspend-resume-hook
3187 if it is bound and value is non-nil. */ 3187 if it is bound and value is non-nil. */
@@ -3284,7 +3284,7 @@ interrupt_signal ()
3284 3284
3285 cancel_echoing (); 3285 cancel_echoing ();
3286 3286
3287 if (!NILP (Vquit_flag) && SCREEN_IS_TERMCAP (selected_screen)) 3287 if (!NILP (Vquit_flag) && FRAME_IS_TERMCAP (selected_frame))
3288 { 3288 {
3289 fflush (stdout); 3289 fflush (stdout);
3290 reset_sys_modes (); 3290 reset_sys_modes ();
@@ -3618,9 +3618,9 @@ Polling is automatically disabled in all other cases.");
3618 "*Number of complete keys read from the keyboard so far."); 3618 "*Number of complete keys read from the keyboard so far.");
3619 num_input_keys = 0; 3619 num_input_keys = 0;
3620 3620
3621 DEFVAR_LISP ("last-event-screen", &Vlast_event_screen, 3621 DEFVAR_LISP ("last-event-frame", &Vlast_event_frame,
3622 "*The screen in which the most recently read event occurred."); 3622 "*The frame in which the most recently read event occurred.");
3623 Vlast_event_screen = Qnil; 3623 Vlast_event_frame = Qnil;
3624 3624
3625 DEFVAR_LISP ("help-char", &help_char, 3625 DEFVAR_LISP ("help-char", &help_char,
3626 "Character to recognize as meaning Help.\n\ 3626 "Character to recognize as meaning Help.\n\
@@ -3656,13 +3656,13 @@ See the variable `mouse-event' for the format of this list.");
3656 "Function to call when mouse leaves window. No arguments."); 3656 "Function to call when mouse leaves window. No arguments.");
3657 Vmouse_left_hook = Qnil; 3657 Vmouse_left_hook = Qnil;
3658 3658
3659 DEFVAR_LISP ("map-screen-hook", &Vmap_screen_hook, 3659 DEFVAR_LISP ("map-frame-hook", &Vmap_frame_hook,
3660 "Function to call when screen is mapped. No arguments."); 3660 "Function to call when frame is mapped. No arguments.");
3661 Vmap_screen_hook = Qnil; 3661 Vmap_frame_hook = Qnil;
3662 3662
3663 DEFVAR_LISP ("unmap-screen-hook", &Vunmap_screen_hook, 3663 DEFVAR_LISP ("unmap-frame-hook", &Vunmap_frame_hook,
3664 "Function to call when screen is unmapped. No arguments."); 3664 "Function to call when frame is unmapped. No arguments.");
3665 Vunmap_screen_hook = Qnil; 3665 Vunmap_frame_hook = Qnil;
3666 3666
3667 DEFVAR_LISP ("mouse-motion-handler", &Vmouse_motion_handler, 3667 DEFVAR_LISP ("mouse-motion-handler", &Vmouse_motion_handler,
3668 "Handler for motion events. No arguments."); 3668 "Handler for motion events. No arguments.");
diff --git a/src/lisp.h b/src/lisp.h
index d981fd74bc5..070ad977f0a 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -86,9 +86,9 @@ enum Lisp_Type
86 XOBJFWD(obj) points to the Lisp_Object variable. */ 86 XOBJFWD(obj) points to the Lisp_Object variable. */
87 Lisp_Objfwd, 87 Lisp_Objfwd,
88 88
89 /* Pointer to a vector-like object describing a display screen 89 /* Pointer to a vector-like object describing a display frame
90 on which Emacs can display a window hierarchy. */ 90 on which Emacs can display a window hierarchy. */
91 Lisp_Screen, 91 Lisp_Frame,
92 92
93 /* Used when a FILE * value needs to be passed 93 /* Used when a FILE * value needs to be passed
94 in an argument of type Lisp_Object. 94 in an argument of type Lisp_Object.
@@ -840,7 +840,7 @@ extern Lisp_Object Qcdr;
840extern Lisp_Object Qfloatp, Qinteger_or_floatp, Qinteger_or_float_or_marker_p; 840extern Lisp_Object Qfloatp, Qinteger_or_floatp, Qinteger_or_float_or_marker_p;
841#endif /* LISP_FLOAT_TYPE */ 841#endif /* LISP_FLOAT_TYPE */
842 842
843extern Lisp_Object Qscreenp; 843extern Lisp_Object Qframep;
844 844
845extern Lisp_Object Feq (), Fnull (), Flistp (), Fconsp (), Fatom (), Fnlistp (); 845extern Lisp_Object Feq (), Fnull (), Flistp (), Fconsp (), Fatom (), Fnlistp ();
846extern Lisp_Object Fintegerp (), Fnatnump (), Fsymbolp (); 846extern Lisp_Object Fintegerp (), Fnatnump (), Fsymbolp ();
@@ -1040,35 +1040,35 @@ extern Lisp_Object Fset_window_configuration (), Fcurrent_window_configuration (
1040extern Lisp_Object Fcoordinates_in_window_p (); 1040extern Lisp_Object Fcoordinates_in_window_p ();
1041extern Lisp_Object Fwindow_at (); 1041extern Lisp_Object Fwindow_at ();
1042 1042
1043/* defined in screen.c */ 1043/* defined in frame.c */
1044extern Lisp_Object Fscreenp (); 1044extern Lisp_Object Fframep ();
1045extern Lisp_Object Fselect_screen (); 1045extern Lisp_Object Fselect_frame ();
1046extern Lisp_Object Ffocus_screen (); 1046extern Lisp_Object Ffocus_frame ();
1047extern Lisp_Object Funfocus_screen (); 1047extern Lisp_Object Funfocus_frame ();
1048extern Lisp_Object Fselected_screen (); 1048extern Lisp_Object Fselected_frame ();
1049extern Lisp_Object Fwindow_screen (); 1049extern Lisp_Object Fwindow_frame ();
1050extern Lisp_Object Fscreen_root_window (); 1050extern Lisp_Object Fframe_root_window ();
1051extern Lisp_Object Fscreen_selected_window (); 1051extern Lisp_Object Fframe_selected_window ();
1052extern Lisp_Object Fscreen_list (); 1052extern Lisp_Object Fframe_list ();
1053extern Lisp_Object Fnext_screen (); 1053extern Lisp_Object Fnext_frame ();
1054extern Lisp_Object Fdelete_screen (); 1054extern Lisp_Object Fdelete_frame ();
1055extern Lisp_Object Fread_mouse_position (); 1055extern Lisp_Object Fread_mouse_position ();
1056extern Lisp_Object Fset_mouse_position (); 1056extern Lisp_Object Fset_mouse_position ();
1057extern Lisp_Object Fmake_screen_visible (); 1057extern Lisp_Object Fmake_frame_visible ();
1058extern Lisp_Object Fmake_screen_invisible (); 1058extern Lisp_Object Fmake_frame_invisible ();
1059extern Lisp_Object Ficonify_screen (); 1059extern Lisp_Object Ficonify_frame ();
1060extern Lisp_Object Fdeiconify_screen (); 1060extern Lisp_Object Fdeiconify_frame ();
1061extern Lisp_Object Fscreen_visible_p (); 1061extern Lisp_Object Fframe_visible_p ();
1062extern Lisp_Object Fvisible_screen_list (); 1062extern Lisp_Object Fvisible_frame_list ();
1063extern Lisp_Object Fscreen_parameters (); 1063extern Lisp_Object Fframe_parameters ();
1064extern Lisp_Object Fmodify_screen_parameters (); 1064extern Lisp_Object Fmodify_frame_parameters ();
1065extern Lisp_Object Fscreen_pixel_size (); 1065extern Lisp_Object Fframe_pixel_size ();
1066extern Lisp_Object Fscreen_height (); 1066extern Lisp_Object Fframe_height ();
1067extern Lisp_Object Fscreen_width (); 1067extern Lisp_Object Fframe_width ();
1068extern Lisp_Object Fset_screen_height (); 1068extern Lisp_Object Fset_frame_height ();
1069extern Lisp_Object Fset_screen_width (); 1069extern Lisp_Object Fset_frame_width ();
1070extern Lisp_Object Fset_screen_size (); 1070extern Lisp_Object Fset_frame_size ();
1071extern Lisp_Object Fset_screen_position (); 1071extern Lisp_Object Fset_frame_position ();
1072#ifndef HAVE_X11 1072#ifndef HAVE_X11
1073extern Lisp_Object Frubber_band_rectangle (); 1073extern Lisp_Object Frubber_band_rectangle ();
1074#endif /* HAVE_X11 */ 1074#endif /* HAVE_X11 */
diff --git a/src/minibuf.c b/src/minibuf.c
index 97cf6d131e7..08abe94e789 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -23,7 +23,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
23#include "commands.h" 23#include "commands.h"
24#include "buffer.h" 24#include "buffer.h"
25#include "dispextern.h" 25#include "dispextern.h"
26#include "screen.h" 26#include "frame.h"
27#include "window.h" 27#include "window.h"
28#include "syntax.h" 28#include "syntax.h"
29 29
@@ -91,7 +91,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag)
91{ 91{
92 register Lisp_Object val; 92 register Lisp_Object val;
93 int count = specpdl_ptr - specpdl; 93 int count = specpdl_ptr - specpdl;
94 Lisp_Object mini_screen = WINDOW_SCREEN (XWINDOW (minibuf_window)); 94 Lisp_Object mini_frame = WINDOW_FRAME (XWINDOW (minibuf_window));
95 struct gcpro gcpro1, gcpro2; 95 struct gcpro gcpro1, gcpro2;
96 96
97 if (XTYPE (prompt) != Lisp_String) 97 if (XTYPE (prompt) != Lisp_String)
@@ -105,7 +105,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag)
105 && minibuf_level > 0 105 && minibuf_level > 0
106 && (EQ (selected_window, minibuf_window))) 106 && (EQ (selected_window, minibuf_window)))
107#if 0 107#if 0
108 || selected_screen != XSCREEN (WINDOW_SCREEN (XWINDOW (minibuf_window))) 108 || selected_frame != XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window)))
109#endif 109#endif
110 error ("Command attempted to use minibuffer while in minibuffer"); 110 error ("Command attempted to use minibuffer while in minibuffer");
111 111
@@ -127,12 +127,12 @@ read_minibuf (map, initial, prompt, backup_n, expflag)
127 record_unwind_protect (Fset_window_configuration, 127 record_unwind_protect (Fset_window_configuration,
128 Fcurrent_window_configuration (Qnil)); 128 Fcurrent_window_configuration (Qnil));
129 129
130 /* If the minibuffer window is on a different screen, save that 130 /* If the minibuffer window is on a different frame, save that
131 screen's configuration too. */ 131 frame's configuration too. */
132 if (XSCREEN (mini_screen) != selected_screen) 132 if (XFRAME (mini_frame) != selected_frame)
133 { 133 {
134 record_unwind_protect (Fset_window_configuration, 134 record_unwind_protect (Fset_window_configuration,
135 Fcurrent_window_configuration (mini_screen)); 135 Fcurrent_window_configuration (mini_frame));
136 } 136 }
137 137
138 val = current_buffer->directory; 138 val = current_buffer->directory;
@@ -141,17 +141,17 @@ read_minibuf (map, initial, prompt, backup_n, expflag)
141 Fmake_local_variable (Qprint_escape_newlines); 141 Fmake_local_variable (Qprint_escape_newlines);
142 print_escape_newlines = 1; 142 print_escape_newlines = 1;
143 143
144#ifdef MULTI_SCREEN 144#ifdef MULTI_FRAME
145 /* If the minibuffer window is on another screen, shift this screen's 145 /* If the minibuffer window is on another frame, shift this frame's
146 focus to that window, and arrange to put it back later. */ 146 focus to that window, and arrange to put it back later. */
147 if (XSCREEN (WINDOW_SCREEN (XWINDOW (minibuf_window))) 147 if (XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window)))
148 != selected_screen) 148 != selected_frame)
149 { 149 {
150 record_unwind_protect (read_minibuf_unwind, 150 record_unwind_protect (read_minibuf_unwind,
151 Fcons (Fselected_screen (), 151 Fcons (Fselected_frame (),
152 SCREEN_FOCUS_SCREEN (selected_screen))); 152 FRAME_FOCUS_FRAME (selected_frame)));
153 153
154 Fredirect_screen_focus (Fselected_screen (), mini_screen); 154 Fredirect_frame_focus (Fselected_frame (), mini_frame);
155 } 155 }
156 else 156 else
157 record_unwind_protect (read_minibuf_unwind, Qnil); 157 record_unwind_protect (read_minibuf_unwind, Qnil);
@@ -186,18 +186,18 @@ read_minibuf (map, initial, prompt, backup_n, expflag)
186 186
187 /* If cursor is on the minibuffer line, 187 /* If cursor is on the minibuffer line,
188 show the user we have exited by putting it in column 0. */ 188 show the user we have exited by putting it in column 0. */
189 if ((SCREEN_CURSOR_Y (selected_screen) 189 if ((FRAME_CURSOR_Y (selected_frame)
190 >= XFASTINT (XWINDOW (minibuf_window)->top)) 190 >= XFASTINT (XWINDOW (minibuf_window)->top))
191 && !noninteractive) 191 && !noninteractive)
192 { 192 {
193 SCREEN_CURSOR_X (selected_screen) = 0; 193 FRAME_CURSOR_X (selected_frame) = 0;
194 update_screen (selected_screen, 1, 1); 194 update_frame (selected_frame, 1, 1);
195 } 195 }
196 196
197 /* Make minibuffer contents into a string */ 197 /* Make minibuffer contents into a string */
198 val = make_buffer_string (1, Z); 198 val = make_buffer_string (1, Z);
199 bcopy (GAP_END_ADDR, XSTRING (val)->data + GPT - BEG, Z - GPT); 199 bcopy (GAP_END_ADDR, XSTRING (val)->data + GPT - BEG, Z - GPT);
200 unbind_to (count, Qnil); /* The appropriate screen will get selected 200 unbind_to (count, Qnil); /* The appropriate frame will get selected
201 in set-window-configuration. */ 201 in set-window-configuration. */
202 202
203 UNGCPRO; 203 UNGCPRO;
@@ -271,10 +271,10 @@ read_minibuf_unwind (data)
271 Vhelp_form = minibuf_save_vector[minibuf_level].help_form; 271 Vhelp_form = minibuf_save_vector[minibuf_level].help_form;
272 Vcurrent_prefix_arg = minibuf_save_vector[minibuf_level].current_prefix_arg; 272 Vcurrent_prefix_arg = minibuf_save_vector[minibuf_level].current_prefix_arg;
273 273
274#ifdef MULTI_SCREEN 274#ifdef MULTI_FRAME
275 /* Redirect the focus of the screen that called the minibuffer. */ 275 /* Redirect the focus of the frame that called the minibuffer. */
276 if (CONSP (data)) 276 if (CONSP (data))
277 Fredirect_screen_focus (XCONS (data)->car, XCONS (data)->cdr); 277 Fredirect_frame_focus (XCONS (data)->car, XCONS (data)->cdr);
278#endif 278#endif
279} 279}
280 280
diff --git a/src/process.c b/src/process.c
index 2265c2c34db..e950a7b4395 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1723,11 +1723,11 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
1723 if (! XINT (read_kbd)) 1723 if (! XINT (read_kbd))
1724 FD_CLR (0, &Available); 1724 FD_CLR (0, &Available);
1725 1725
1726 /* If screen size has changed or the window is newly mapped, 1726 /* If frame size has changed or the window is newly mapped,
1727 redisplay now, before we start to wait. There is a race 1727 redisplay now, before we start to wait. There is a race
1728 condition here; if a SIGIO arrives between now and the select 1728 condition here; if a SIGIO arrives between now and the select
1729 and indicates that a screen is trashed, we lose. */ 1729 and indicates that a frame is trashed, we lose. */
1730 if (screen_garbaged) 1730 if (frame_garbaged)
1731 redisplay_preserve_echo_area (); 1731 redisplay_preserve_echo_area ();
1732 1732
1733 if (XINT (read_kbd) && detect_input_pending ()) 1733 if (XINT (read_kbd) && detect_input_pending ())
@@ -2898,7 +2898,7 @@ effect when `start-process' is called.");
2898#include "systime.h" 2898#include "systime.h"
2899#include "termopts.h" 2899#include "termopts.h"
2900 2900
2901extern int screen_garbaged; 2901extern int frame_garbaged;
2902 2902
2903 2903
2904/* As described above, except assuming that there are no subprocesses: 2904/* As described above, except assuming that there are no subprocesses:
@@ -2981,9 +2981,9 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display)
2981 if (XINT (read_kbd) < 0) 2981 if (XINT (read_kbd) < 0)
2982 set_waiting_for_input (&timeout); 2982 set_waiting_for_input (&timeout);
2983 2983
2984 /* If a screen has been newly mapped and needs updating, 2984 /* If a frame has been newly mapped and needs updating,
2985 reprocess its display stuff. */ 2985 reprocess its display stuff. */
2986 if (screen_garbaged) 2986 if (frame_garbaged)
2987 redisplay_preserve_echo_area (); 2987 redisplay_preserve_echo_area ();
2988 2988
2989 if (XINT (read_kbd) && detect_input_pending ()) 2989 if (XINT (read_kbd) && detect_input_pending ())
diff --git a/src/term.c b/src/term.c
index 3663c44ff91..ede02179c8b 100644
--- a/src/term.c
+++ b/src/term.c
@@ -26,7 +26,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
26#include "cm.h" 26#include "cm.h"
27#undef NULL 27#undef NULL
28#include "lisp.h" 28#include "lisp.h"
29#include "screen.h" 29#include "frame.h"
30#include "disptab.h" 30#include "disptab.h"
31#include "termhooks.h" 31#include "termhooks.h"
32#include "keyboard.h" 32#include "keyboard.h"
@@ -34,10 +34,10 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
34#define max(a, b) ((a) > (b) ? (a) : (b)) 34#define max(a, b) ((a) > (b) ? (a) : (b))
35#define min(a, b) ((a) < (b) ? (a) : (b)) 35#define min(a, b) ((a) < (b) ? (a) : (b))
36 36
37#define OUTPUT(a) tputs (a, SCREEN_HEIGHT (selected_screen) - curY, cmputc) 37#define OUTPUT(a) tputs (a, FRAME_HEIGHT (selected_frame) - curY, cmputc)
38#define OUTPUT1(a) tputs (a, 1, cmputc) 38#define OUTPUT1(a) tputs (a, 1, cmputc)
39#define OUTPUTL(a, lines) tputs (a, lines, cmputc) 39#define OUTPUTL(a, lines) tputs (a, lines, cmputc)
40#define OUTPUT_IF(a) { if (a) tputs (a, SCREEN_HEIGHT (selected_screen) - curY, cmputc); } 40#define OUTPUT_IF(a) { if (a) tputs (a, FRAME_HEIGHT (selected_frame) - curY, cmputc); }
41#define OUTPUT1_IF(a) { if (a) tputs (a, 1, cmputc); } 41#define OUTPUT1_IF(a) { if (a) tputs (a, 1, cmputc); }
42 42
43/* Terminal charateristics that higher levels want to look at. 43/* Terminal charateristics that higher levels want to look at.
@@ -52,14 +52,14 @@ int line_ins_del_ok; /* Terminal can insert and delete lines */
52int char_ins_del_ok; /* Terminal can insert and delete chars */ 52int char_ins_del_ok; /* Terminal can insert and delete chars */
53int scroll_region_ok; /* Terminal supports setting the 53int scroll_region_ok; /* Terminal supports setting the
54 scroll window */ 54 scroll window */
55int memory_below_screen; /* Terminal remembers lines 55int memory_below_frame; /* Terminal remembers lines
56 scrolled off bottom */ 56 scrolled off bottom */
57int fast_clear_end_of_line; /* Terminal has a `ce' string */ 57int fast_clear_end_of_line; /* Terminal has a `ce' string */
58 58
59int dont_calculate_costs; /* Nonzero means don't bother computing */ 59int dont_calculate_costs; /* Nonzero means don't bother computing */
60 /* various cost tables; we won't use them. */ 60 /* various cost tables; we won't use them. */
61 61
62/* Nonzero means no need to redraw the entire screen on resuming 62/* Nonzero means no need to redraw the entire frame on resuming
63 a suspended Emacs. This is useful on terminals with multiple pages, 63 a suspended Emacs. This is useful on terminals with multiple pages,
64 where one page is used for Emacs and another for all else. */ 64 where one page is used for Emacs and another for all else. */
65int no_redraw_on_reenter; 65int no_redraw_on_reenter;
@@ -71,7 +71,7 @@ int (*cursor_to_hook) ();
71int (*raw_cursor_to_hook) (); 71int (*raw_cursor_to_hook) ();
72 72
73int (*clear_to_end_hook) (); 73int (*clear_to_end_hook) ();
74int (*clear_screen_hook) (); 74int (*clear_frame_hook) ();
75int (*clear_end_of_line_hook) (); 75int (*clear_end_of_line_hook) ();
76 76
77int (*ins_del_lines_hook) (); 77int (*ins_del_lines_hook) ();
@@ -95,17 +95,17 @@ int (*read_socket_hook) ();
95 95
96/* Return the current position of the mouse. This should clear 96/* Return the current position of the mouse. This should clear
97 mouse_moved until the next motion event arrives. */ 97 mouse_moved until the next motion event arrives. */
98void (*mouse_position_hook) ( /* SCREEN_PTR *s, 98void (*mouse_position_hook) ( /* FRAME_PTR *f,
99 Lisp_Object *x, 99 Lisp_Object *x,
100 Lisp_Object *y, 100 Lisp_Object *y,
101 unsigned long *time */ ); 101 unsigned long *time */ );
102 102
103/* When reading from a minibuffer in a different screen, Emacs wants 103/* When reading from a minibuffer in a different frame, Emacs wants
104 to shift the highlight from the selected screen to the minibuffer's 104 to shift the highlight from the selected frame to the minibuffer's
105 screen; under X, this means it lies about where the focus is. 105 frame; under X, this means it lies about where the focus is.
106 This hook tells the window system code to re-decide where to put 106 This hook tells the window system code to re-decide where to put
107 the highlight. */ 107 the highlight. */
108void (*screen_rehighlight_hook) ( /* SCREEN_PTR s */ ); 108void (*frame_rehighlight_hook) ( /* FRAME_PTR f */ );
109 109
110/* Strings, numbers and flags taken from the termcap entry. */ 110/* Strings, numbers and flags taken from the termcap entry. */
111 111
@@ -114,7 +114,7 @@ char *TS_ins_multi_lines; /* "AL" (one parameter, # lines to insert) */
114char *TS_bell; /* "bl" */ 114char *TS_bell; /* "bl" */
115char *TS_clr_to_bottom; /* "cd" */ 115char *TS_clr_to_bottom; /* "cd" */
116char *TS_clr_line; /* "ce", clear to end of line */ 116char *TS_clr_line; /* "ce", clear to end of line */
117char *TS_clr_screen; /* "cl" */ 117char *TS_clr_frame; /* "cl" */
118char *TS_set_scroll_region; /* "cs" (2 params, first line and last line) */ 118char *TS_set_scroll_region; /* "cs" (2 params, first line and last line) */
119char *TS_set_scroll_region_1; /* "cS" (4 params: total lines, 119char *TS_set_scroll_region_1; /* "cS" (4 params: total lines,
120 lines above scroll region, lines below it, 120 lines above scroll region, lines below it,
@@ -186,24 +186,24 @@ int insert_mode; /* Nonzero when in insert mode. */
186int standout_mode; /* Nonzero when in standout mode. */ 186int standout_mode; /* Nonzero when in standout mode. */
187 187
188/* Size of window specified by higher levels. 188/* Size of window specified by higher levels.
189 This is the number of lines, from the top of screen downwards, 189 This is the number of lines, from the top of frame downwards,
190 which can participate in insert-line/delete-line operations. 190 which can participate in insert-line/delete-line operations.
191 191
192 Effectively it excludes the bottom screen_height - specified_window_size 192 Effectively it excludes the bottom frame_height - specified_window_size
193 lines from those operations. */ 193 lines from those operations. */
194 194
195int specified_window; 195int specified_window;
196 196
197/* Screen currently being redisplayed; 0 if not currently redisplaying. 197/* Frame currently being redisplayed; 0 if not currently redisplaying.
198 (Direct output does not count). */ 198 (Direct output does not count). */
199 199
200SCREEN_PTR updating_screen; 200FRAME_PTR updating_frame;
201 201
202char *tparam (); 202char *tparam ();
203 203
204ring_bell () 204ring_bell ()
205{ 205{
206 if (! SCREEN_IS_TERMCAP (selected_screen)) 206 if (! FRAME_IS_TERMCAP (selected_frame))
207 { 207 {
208 (*ring_bell_hook) (); 208 (*ring_bell_hook) ();
209 return; 209 return;
@@ -213,7 +213,7 @@ ring_bell ()
213 213
214set_terminal_modes () 214set_terminal_modes ()
215{ 215{
216 if (! SCREEN_IS_TERMCAP (selected_screen)) 216 if (! FRAME_IS_TERMCAP (selected_frame))
217 { 217 {
218 (*set_terminal_modes_hook) (); 218 (*set_terminal_modes_hook) ();
219 return; 219 return;
@@ -226,7 +226,7 @@ set_terminal_modes ()
226 226
227reset_terminal_modes () 227reset_terminal_modes ()
228{ 228{
229 if (! SCREEN_IS_TERMCAP (selected_screen)) 229 if (! FRAME_IS_TERMCAP (selected_frame))
230 { 230 {
231 (*reset_terminal_modes_hook) (); 231 (*reset_terminal_modes_hook) ();
232 return; 232 return;
@@ -239,44 +239,44 @@ reset_terminal_modes ()
239 OUTPUT_IF (TS_end_termcap_modes); 239 OUTPUT_IF (TS_end_termcap_modes);
240 /* Output raw CR so kernel can track the cursor hpos. */ 240 /* Output raw CR so kernel can track the cursor hpos. */
241 /* But on magic-cookie terminals this can erase an end-standout marker and 241 /* But on magic-cookie terminals this can erase an end-standout marker and
242 cause the rest of the screen to be in standout, so move down first. */ 242 cause the rest of the frame to be in standout, so move down first. */
243 if (TN_standout_width >= 0) 243 if (TN_standout_width >= 0)
244 cmputc ('\n'); 244 cmputc ('\n');
245 cmputc ('\r'); 245 cmputc ('\r');
246} 246}
247 247
248update_begin (s) 248update_begin (f)
249 SCREEN_PTR s; 249 FRAME_PTR f;
250{ 250{
251 updating_screen = s; 251 updating_frame = f;
252 if (! SCREEN_IS_TERMCAP (updating_screen)) 252 if (! FRAME_IS_TERMCAP (updating_frame))
253 (*update_begin_hook) (s); 253 (*update_begin_hook) (f);
254} 254}
255 255
256update_end (s) 256update_end (f)
257 SCREEN_PTR s; 257 FRAME_PTR f;
258{ 258{
259 if (! SCREEN_IS_TERMCAP (updating_screen)) 259 if (! FRAME_IS_TERMCAP (updating_frame))
260 { 260 {
261 (*update_end_hook) (s); 261 (*update_end_hook) (f);
262 updating_screen = 0; 262 updating_frame = 0;
263 return; 263 return;
264 } 264 }
265 turn_off_insert (); 265 turn_off_insert ();
266 background_highlight (); 266 background_highlight ();
267 standout_requested = 0; 267 standout_requested = 0;
268 updating_screen = 0; 268 updating_frame = 0;
269} 269}
270 270
271set_terminal_window (size) 271set_terminal_window (size)
272 int size; 272 int size;
273{ 273{
274 if (! SCREEN_IS_TERMCAP (updating_screen)) 274 if (! FRAME_IS_TERMCAP (updating_frame))
275 { 275 {
276 (*set_terminal_window_hook) (size); 276 (*set_terminal_window_hook) (size);
277 return; 277 return;
278 } 278 }
279 specified_window = size ? size : SCREEN_HEIGHT (selected_screen); 279 specified_window = size ? size : FRAME_HEIGHT (selected_frame);
280 if (!scroll_region_ok) 280 if (!scroll_region_ok)
281 return; 281 return;
282 set_scroll_region (0, specified_window); 282 set_scroll_region (0, specified_window);
@@ -293,13 +293,13 @@ set_scroll_region (start, stop)
293 else if (TS_set_scroll_region_1) 293 else if (TS_set_scroll_region_1)
294 { 294 {
295 buf = tparam (TS_set_scroll_region_1, 0, 0, 295 buf = tparam (TS_set_scroll_region_1, 0, 0,
296 SCREEN_HEIGHT (selected_screen), start, 296 FRAME_HEIGHT (selected_frame), start,
297 SCREEN_HEIGHT (selected_screen) - stop, 297 FRAME_HEIGHT (selected_frame) - stop,
298 SCREEN_HEIGHT (selected_screen)); 298 FRAME_HEIGHT (selected_frame));
299 } 299 }
300 else 300 else
301 { 301 {
302 buf = tparam (TS_set_window, 0, 0, start, 0, stop, SCREEN_WIDTH (selected_screen)); 302 buf = tparam (TS_set_window, 0, 0, start, 0, stop, FRAME_WIDTH (selected_frame));
303 } 303 }
304 OUTPUT (buf); 304 OUTPUT (buf);
305 free (buf); 305 free (buf);
@@ -376,7 +376,7 @@ highlight_if_desired ()
376 376
377/* Handle standout mode for terminals in which TN_standout_width >= 0. 377/* Handle standout mode for terminals in which TN_standout_width >= 0.
378 On these terminals, standout is controlled by markers that 378 On these terminals, standout is controlled by markers that
379 live inside the screen memory. TN_standout_width is the width 379 live inside the terminal's memory. TN_standout_width is the width
380 that the marker occupies in memory. Standout runs from the marker 380 that the marker occupies in memory. Standout runs from the marker
381 to the end of the line on some terminals, or to the next 381 to the end of the line on some terminals, or to the next
382 turn-off-standout marker (TS_end_standout_mode) string 382 turn-off-standout marker (TS_end_standout_mode) string
@@ -406,7 +406,7 @@ reassert_line_highlight (highlight, vpos)
406 int highlight; 406 int highlight;
407 int vpos; 407 int vpos;
408{ 408{
409 if (! SCREEN_IS_TERMCAP ((updating_screen ? updating_screen : selected_screen))) 409 if (! FRAME_IS_TERMCAP ((updating_frame ? updating_frame : selected_frame)))
410 { 410 {
411 (*reassert_line_highlight_hook) (highlight, vpos); 411 (*reassert_line_highlight_hook) (highlight, vpos);
412 return; 412 return;
@@ -427,7 +427,7 @@ change_line_highlight (new_highlight, vpos, first_unused_hpos)
427 int new_highlight, vpos, first_unused_hpos; 427 int new_highlight, vpos, first_unused_hpos;
428{ 428{
429 standout_requested = new_highlight; 429 standout_requested = new_highlight;
430 if (! SCREEN_IS_TERMCAP (updating_screen)) 430 if (! FRAME_IS_TERMCAP (updating_frame))
431 { 431 {
432 (*change_line_highlight_hook) (new_highlight, vpos, first_unused_hpos); 432 (*change_line_highlight_hook) (new_highlight, vpos, first_unused_hpos);
433 return; 433 return;
@@ -444,7 +444,7 @@ change_line_highlight (new_highlight, vpos, first_unused_hpos)
444 /* On Teleray, make sure to erase the SO marker. */ 444 /* On Teleray, make sure to erase the SO marker. */
445 if (TF_teleray) 445 if (TF_teleray)
446 { 446 {
447 cmgoto (curY - 1, SCREEN_WIDTH (selected_screen) - 4); 447 cmgoto (curY - 1, FRAME_WIDTH (selected_frame) - 4);
448 OUTPUT ("\033S"); 448 OUTPUT ("\033S");
449 curY++; /* ESC S moves to next line where the TS_standout_mode was */ 449 curY++; /* ESC S moves to next line where the TS_standout_mode was */
450 curX = 0; 450 curX = 0;
@@ -462,9 +462,9 @@ change_line_highlight (new_highlight, vpos, first_unused_hpos)
462cursor_to (row, col) 462cursor_to (row, col)
463 int row, col; 463 int row, col;
464{ 464{
465 if (! SCREEN_IS_TERMCAP ((updating_screen 465 if (! FRAME_IS_TERMCAP ((updating_frame
466 ? updating_screen 466 ? updating_frame
467 : selected_screen)) 467 : selected_frame))
468 && cursor_to_hook) 468 && cursor_to_hook)
469 { 469 {
470 (*cursor_to_hook) (row, col); 470 (*cursor_to_hook) (row, col);
@@ -486,7 +486,7 @@ cursor_to (row, col)
486raw_cursor_to (row, col) 486raw_cursor_to (row, col)
487 int row, col; 487 int row, col;
488{ 488{
489 if (! SCREEN_IS_TERMCAP ((updating_screen ? updating_screen : selected_screen))) 489 if (! FRAME_IS_TERMCAP ((updating_frame ? updating_frame : selected_frame)))
490 { 490 {
491 (*raw_cursor_to_hook) (row, col); 491 (*raw_cursor_to_hook) (row, col);
492 return; 492 return;
@@ -502,12 +502,12 @@ raw_cursor_to (row, col)
502 502
503/* Erase operations */ 503/* Erase operations */
504 504
505/* clear from cursor to end of screen */ 505/* clear from cursor to end of frame */
506clear_to_end () 506clear_to_end ()
507{ 507{
508 register int i; 508 register int i;
509 509
510 if (clear_to_end_hook && SCREEN_IS_TERMCAP (updating_screen)) 510 if (clear_to_end_hook && FRAME_IS_TERMCAP (updating_frame))
511 { 511 {
512 (*clear_to_end_hook) (); 512 (*clear_to_end_hook) ();
513 return; 513 return;
@@ -516,33 +516,33 @@ clear_to_end ()
516 { 516 {
517 background_highlight (); 517 background_highlight ();
518 OUTPUT (TS_clr_to_bottom); 518 OUTPUT (TS_clr_to_bottom);
519 bzero (chars_wasted + curY, SCREEN_HEIGHT (selected_screen) - curY); 519 bzero (chars_wasted + curY, FRAME_HEIGHT (selected_frame) - curY);
520 } 520 }
521 else 521 else
522 { 522 {
523 for (i = curY; i < SCREEN_HEIGHT (selected_screen); i++) 523 for (i = curY; i < FRAME_HEIGHT (selected_frame); i++)
524 { 524 {
525 cursor_to (i, 0); 525 cursor_to (i, 0);
526 clear_end_of_line_raw (SCREEN_WIDTH (selected_screen)); 526 clear_end_of_line_raw (FRAME_WIDTH (selected_frame));
527 } 527 }
528 } 528 }
529} 529}
530 530
531/* Clear entire screen */ 531/* Clear entire frame */
532 532
533clear_screen () 533clear_frame ()
534{ 534{
535 if (clear_screen_hook 535 if (clear_frame_hook
536 && ! SCREEN_IS_TERMCAP ((updating_screen ? updating_screen : selected_screen))) 536 && ! FRAME_IS_TERMCAP ((updating_frame ? updating_frame : selected_frame)))
537 { 537 {
538 (*clear_screen_hook) (); 538 (*clear_frame_hook) ();
539 return; 539 return;
540 } 540 }
541 if (TS_clr_screen) 541 if (TS_clr_frame)
542 { 542 {
543 background_highlight (); 543 background_highlight ();
544 OUTPUT (TS_clr_screen); 544 OUTPUT (TS_clr_frame);
545 bzero (chars_wasted, SCREEN_HEIGHT (selected_screen)); 545 bzero (chars_wasted, FRAME_HEIGHT (selected_frame));
546 cmat (0, 0); 546 cmat (0, 0);
547 } 547 }
548 else 548 else
@@ -563,7 +563,7 @@ clear_end_of_line (first_unused_hpos)
563 int first_unused_hpos; 563 int first_unused_hpos;
564{ 564{
565 static GLYPH buf[1] = {SPACEGLYPH}; 565 static GLYPH buf[1] = {SPACEGLYPH};
566 if (SCREEN_IS_TERMCAP (selected_screen) 566 if (FRAME_IS_TERMCAP (selected_frame)
567 && TN_standout_width == 0 && curX == 0 && chars_wasted[curY] != 0) 567 && TN_standout_width == 0 && curX == 0 && chars_wasted[curY] != 0)
568 write_glyphs (buf, 1); 568 write_glyphs (buf, 1);
569 clear_end_of_line_raw (first_unused_hpos); 569 clear_end_of_line_raw (first_unused_hpos);
@@ -581,9 +581,9 @@ clear_end_of_line_raw (first_unused_hpos)
581 register int i; 581 register int i;
582 582
583 if (clear_end_of_line_hook 583 if (clear_end_of_line_hook
584 && ! SCREEN_IS_TERMCAP ((updating_screen 584 && ! FRAME_IS_TERMCAP ((updating_frame
585 ? updating_screen 585 ? updating_frame
586 : selected_screen))) 586 : selected_frame)))
587 { 587 {
588 (*clear_end_of_line_hook) (first_unused_hpos); 588 (*clear_end_of_line_hook) (first_unused_hpos);
589 return; 589 return;
@@ -605,8 +605,8 @@ clear_end_of_line_raw (first_unused_hpos)
605 turn_off_insert (); 605 turn_off_insert ();
606 606
607 /* Do not write in last row last col with Autowrap on. */ 607 /* Do not write in last row last col with Autowrap on. */
608 if (AutoWrap && curY == SCREEN_HEIGHT (selected_screen) - 1 608 if (AutoWrap && curY == FRAME_HEIGHT (selected_frame) - 1
609 && first_unused_hpos == SCREEN_WIDTH (selected_screen)) 609 && first_unused_hpos == FRAME_WIDTH (selected_frame))
610 first_unused_hpos--; 610 first_unused_hpos--;
611 611
612 for (i = curX; i < first_unused_hpos; i++) 612 for (i = curX; i < first_unused_hpos; i++)
@@ -629,7 +629,7 @@ write_glyphs (string, len)
629 register Lisp_Object *tbase = GLYPH_TABLE_BASE; 629 register Lisp_Object *tbase = GLYPH_TABLE_BASE;
630 630
631 if (write_glyphs_hook 631 if (write_glyphs_hook
632 && ! SCREEN_IS_TERMCAP ((updating_screen ? updating_screen : selected_screen))) 632 && ! FRAME_IS_TERMCAP ((updating_frame ? updating_frame : selected_frame)))
633 { 633 {
634 (*write_glyphs_hook) (string, len); 634 (*write_glyphs_hook) (string, len);
635 return; 635 return;
@@ -639,12 +639,12 @@ write_glyphs (string, len)
639 turn_off_insert (); 639 turn_off_insert ();
640 640
641 /* Don't dare write in last column of bottom line, if AutoWrap, 641 /* Don't dare write in last column of bottom line, if AutoWrap,
642 since that would scroll the whole screen on some terminals. */ 642 since that would scroll the whole frame on some terminals. */
643 643
644 if (AutoWrap 644 if (AutoWrap
645 && curY + 1 == SCREEN_HEIGHT (selected_screen) 645 && curY + 1 == FRAME_HEIGHT (selected_frame)
646 && (curX + len - (chars_wasted[curY] & 077) 646 && (curX + len - (chars_wasted[curY] & 077)
647 == SCREEN_WIDTH (selected_screen))) 647 == FRAME_WIDTH (selected_frame)))
648 len --; 648 len --;
649 649
650 cmplus (len); 650 cmplus (len);
@@ -696,7 +696,7 @@ insert_glyphs (start, len)
696 register int tlen = GLYPH_TABLE_LENGTH; 696 register int tlen = GLYPH_TABLE_LENGTH;
697 register Lisp_Object *tbase = GLYPH_TABLE_BASE; 697 register Lisp_Object *tbase = GLYPH_TABLE_BASE;
698 698
699 if (insert_glyphs_hook && ! SCREEN_IS_TERMCAP (updating_screen)) 699 if (insert_glyphs_hook && ! FRAME_IS_TERMCAP (updating_frame))
700 { 700 {
701 (*insert_glyphs_hook) (start, len); 701 (*insert_glyphs_hook) (start, len);
702 return; 702 return;
@@ -751,7 +751,7 @@ delete_glyphs (n)
751 char *buf; 751 char *buf;
752 register int i; 752 register int i;
753 753
754 if (delete_glyphs_hook && ! SCREEN_IS_TERMCAP (updating_screen)) 754 if (delete_glyphs_hook && ! FRAME_IS_TERMCAP (updating_frame))
755 { 755 {
756 (*delete_glyphs_hook) (n); 756 (*delete_glyphs_hook) (n);
757 return; 757 return;
@@ -792,7 +792,7 @@ ins_del_lines (vpos, n)
792 register int i = n > 0 ? n : -n; 792 register int i = n > 0 ? n : -n;
793 register char *buf; 793 register char *buf;
794 794
795 if (ins_del_lines_hook && ! SCREEN_IS_TERMCAP (updating_screen)) 795 if (ins_del_lines_hook && ! FRAME_IS_TERMCAP (updating_frame))
796 { 796 {
797 (*ins_del_lines_hook) (vpos, n); 797 (*ins_del_lines_hook) (vpos, n);
798 return; 798 return;
@@ -807,7 +807,7 @@ ins_del_lines (vpos, n)
807 as there will be a matching inslines later that will flush them. */ 807 as there will be a matching inslines later that will flush them. */
808 if (scroll_region_ok && vpos + i >= specified_window) 808 if (scroll_region_ok && vpos + i >= specified_window)
809 return; 809 return;
810 if (!memory_below_screen && vpos + i >= SCREEN_HEIGHT (selected_screen)) 810 if (!memory_below_frame && vpos + i >= FRAME_HEIGHT (selected_frame))
811 return; 811 return;
812 812
813 if (multi) 813 if (multi)
@@ -845,7 +845,7 @@ ins_del_lines (vpos, n)
845 register lower_limit 845 register lower_limit
846 = (scroll_region_ok 846 = (scroll_region_ok
847 ? specified_window 847 ? specified_window
848 : SCREEN_HEIGHT (selected_screen)); 848 : FRAME_HEIGHT (selected_frame));
849 849
850 if (n < 0) 850 if (n < 0)
851 { 851 {
@@ -861,9 +861,9 @@ ins_del_lines (vpos, n)
861 bzero (&chars_wasted[vpos], n); 861 bzero (&chars_wasted[vpos], n);
862 } 862 }
863 } 863 }
864 if (!scroll_region_ok && memory_below_screen && n < 0) 864 if (!scroll_region_ok && memory_below_frame && n < 0)
865 { 865 {
866 cursor_to (SCREEN_HEIGHT (selected_screen) + n, 0); 866 cursor_to (FRAME_HEIGHT (selected_frame) + n, 0);
867 clear_to_end (); 867 clear_to_end ();
868 } 868 }
869} 869}
@@ -916,13 +916,13 @@ per_line_cost (str)
916 916
917int *char_ins_del_vector; 917int *char_ins_del_vector;
918 918
919#define char_ins_del_cost(s) (&char_ins_del_vector[SCREEN_WIDTH ((s))]) 919#define char_ins_del_cost(f) (&char_ins_del_vector[FRAME_WIDTH ((f))])
920#endif 920#endif
921 921
922/* ARGSUSED */ 922/* ARGSUSED */
923static void 923static void
924calculate_ins_del_char_costs (screen) 924calculate_ins_del_char_costs (frame)
925 SCREEN_PTR screen; 925 FRAME_PTR frame;
926{ 926{
927 int ins_startup_cost, del_startup_cost; 927 int ins_startup_cost, del_startup_cost;
928 int ins_cost_per_char, del_cost_per_char; 928 int ins_cost_per_char, del_cost_per_char;
@@ -968,27 +968,27 @@ calculate_ins_del_char_costs (screen)
968 } 968 }
969 969
970 /* Delete costs are at negative offsets */ 970 /* Delete costs are at negative offsets */
971 p = &char_ins_del_cost (screen)[0]; 971 p = &char_ins_del_cost (frame)[0];
972 for (i = SCREEN_WIDTH (selected_screen); --i >= 0;) 972 for (i = FRAME_WIDTH (selected_frame); --i >= 0;)
973 *--p = (del_startup_cost += del_cost_per_char); 973 *--p = (del_startup_cost += del_cost_per_char);
974 974
975 /* Doing nothing is free */ 975 /* Doing nothing is free */
976 p = &char_ins_del_cost (screen)[0]; 976 p = &char_ins_del_cost (frame)[0];
977 *p++ = 0; 977 *p++ = 0;
978 978
979 /* Insert costs are at positive offsets */ 979 /* Insert costs are at positive offsets */
980 for (i = SCREEN_WIDTH (screen); --i >= 0;) 980 for (i = FRAME_WIDTH (frame); --i >= 0;)
981 *p++ = (ins_startup_cost += ins_cost_per_char); 981 *p++ = (ins_startup_cost += ins_cost_per_char);
982} 982}
983 983
984#ifdef HAVE_X_WINDOWS 984#ifdef HAVE_X_WINDOWS
985extern int x_screen_planes; 985extern int x_frame_planes;
986#endif 986#endif
987 987
988calculate_costs (screen) 988calculate_costs (frame)
989 SCREEN_PTR screen; 989 FRAME_PTR frame;
990{ 990{
991 register char *s = TS_set_scroll_region ? 991 register char *f = TS_set_scroll_region ?
992 TS_set_scroll_region 992 TS_set_scroll_region
993 : TS_set_scroll_region_1; 993 : TS_set_scroll_region_1;
994 994
@@ -996,16 +996,16 @@ calculate_costs (screen)
996 return; 996 return;
997 997
998#ifdef HAVE_X_WINDOWS 998#ifdef HAVE_X_WINDOWS
999 if (SCREEN_IS_X (screen)) 999 if (FRAME_IS_X (frame))
1000 { 1000 {
1001 do_line_insertion_deletion_costs (screen, 0, ".5*", 0, ".5*", 1001 do_line_insertion_deletion_costs (frame, 0, ".5*", 0, ".5*",
1002 0, 0, x_screen_planes); 1002 0, 0, x_frame_planes);
1003 return; 1003 return;
1004 } 1004 }
1005#endif 1005#endif
1006 1006
1007 /* These variables are only used for terminal stuff. They are allocated 1007 /* These variables are only used for terminal stuff. They are allocated
1008 once for the terminal screen of X-windows emacs, but not used afterwards. 1008 once for the terminal frame of X-windows emacs, but not used afterwards.
1009 1009
1010 char_ins_del_vector (i.e., char_ins_del_cost) isn't used because 1010 char_ins_del_vector (i.e., char_ins_del_cost) isn't used because
1011 X turns off char_ins_del_ok. 1011 X turns off char_ins_del_ok.
@@ -1014,48 +1014,48 @@ calculate_costs (screen)
1014 the term hook isn't called. */ 1014 the term hook isn't called. */
1015 1015
1016 if (chars_wasted != 0) 1016 if (chars_wasted != 0)
1017 chars_wasted = (char *) xrealloc (chars_wasted, SCREEN_HEIGHT (screen)); 1017 chars_wasted = (char *) xrealloc (chars_wasted, FRAME_HEIGHT (frame));
1018 else 1018 else
1019 chars_wasted = (char *) xmalloc (SCREEN_HEIGHT (screen)); 1019 chars_wasted = (char *) xmalloc (FRAME_HEIGHT (frame));
1020 1020
1021 if (copybuf != 0) 1021 if (copybuf != 0)
1022 copybuf = (char *) xrealloc (copybuf, SCREEN_HEIGHT (screen)); 1022 copybuf = (char *) xrealloc (copybuf, FRAME_HEIGHT (frame));
1023 else 1023 else
1024 copybuf = (char *) xmalloc (SCREEN_HEIGHT (screen)); 1024 copybuf = (char *) xmalloc (FRAME_HEIGHT (frame));
1025 1025
1026 if (char_ins_del_vector != 0) 1026 if (char_ins_del_vector != 0)
1027 char_ins_del_vector 1027 char_ins_del_vector
1028 = (int *) xrealloc (char_ins_del_vector, 1028 = (int *) xrealloc (char_ins_del_vector,
1029 (sizeof (int) 1029 (sizeof (int)
1030 + 2 * SCREEN_WIDTH (screen) * sizeof (int))); 1030 + 2 * FRAME_WIDTH (frame) * sizeof (int)));
1031 else 1031 else
1032 char_ins_del_vector 1032 char_ins_del_vector
1033 = (int *) xmalloc (sizeof (int) 1033 = (int *) xmalloc (sizeof (int)
1034 + 2 * SCREEN_WIDTH (screen) * sizeof (int)); 1034 + 2 * FRAME_WIDTH (frame) * sizeof (int));
1035 1035
1036 bzero (chars_wasted, SCREEN_HEIGHT (screen)); 1036 bzero (chars_wasted, FRAME_HEIGHT (frame));
1037 bzero (copybuf, SCREEN_HEIGHT (screen)); 1037 bzero (copybuf, FRAME_HEIGHT (frame));
1038 bzero (char_ins_del_vector, (sizeof (int) 1038 bzero (char_ins_del_vector, (sizeof (int)
1039 + 2 * SCREEN_WIDTH (screen) * sizeof (int))); 1039 + 2 * FRAME_WIDTH (frame) * sizeof (int)));
1040 1040
1041 if (s && (!TS_ins_line && !TS_del_line)) 1041 if (f && (!TS_ins_line && !TS_del_line))
1042 do_line_insertion_deletion_costs (screen, 1042 do_line_insertion_deletion_costs (frame,
1043 TS_rev_scroll, TS_ins_multi_lines, 1043 TS_rev_scroll, TS_ins_multi_lines,
1044 TS_fwd_scroll, TS_del_multi_lines, 1044 TS_fwd_scroll, TS_del_multi_lines,
1045 s, s, 1); 1045 f, f, 1);
1046 else 1046 else
1047 do_line_insertion_deletion_costs (screen, 1047 do_line_insertion_deletion_costs (frame,
1048 TS_ins_line, TS_ins_multi_lines, 1048 TS_ins_line, TS_ins_multi_lines,
1049 TS_del_line, TS_del_multi_lines, 1049 TS_del_line, TS_del_multi_lines,
1050 0, 0, 1); 1050 0, 0, 1);
1051 1051
1052 calculate_ins_del_char_costs (screen); 1052 calculate_ins_del_char_costs (frame);
1053 1053
1054 /* Don't use TS_repeat if its padding is worse than sending the chars */ 1054 /* Don't use TS_repeat if its padding is worse than sending the chars */
1055 if (TS_repeat && per_line_cost (TS_repeat) * baud_rate < 9000) 1055 if (TS_repeat && per_line_cost (TS_repeat) * baud_rate < 9000)
1056 RPov = string_cost (TS_repeat); 1056 RPov = string_cost (TS_repeat);
1057 else 1057 else
1058 RPov = SCREEN_WIDTH (screen) * 2; 1058 RPov = FRAME_WIDTH (frame) * 2;
1059 1059
1060 cmcostinit (); /* set up cursor motion costs */ 1060 cmcostinit (); /* set up cursor motion costs */
1061} 1061}
@@ -1151,7 +1151,7 @@ term_init (terminal_type)
1151 BackTab = tgetstr ("bt", address); 1151 BackTab = tgetstr ("bt", address);
1152 TS_clr_to_bottom = tgetstr ("cd", address); 1152 TS_clr_to_bottom = tgetstr ("cd", address);
1153 TS_clr_line = tgetstr ("ce", address); 1153 TS_clr_line = tgetstr ("ce", address);
1154 TS_clr_screen = tgetstr ("cl", address); 1154 TS_clr_frame = tgetstr ("cl", address);
1155 ColPosition = tgetstr ("ch", address); 1155 ColPosition = tgetstr ("ch", address);
1156 AbsPosition = tgetstr ("cm", address); 1156 AbsPosition = tgetstr ("cm", address);
1157 CR = tgetstr ("cr", address); 1157 CR = tgetstr ("cr", address);
@@ -1209,7 +1209,7 @@ term_init (terminal_type)
1209 MultiRight = tgetstr ("RI", address); 1209 MultiRight = tgetstr ("RI", address);
1210 1210
1211 AutoWrap = tgetflag ("am"); 1211 AutoWrap = tgetflag ("am");
1212 memory_below_screen = tgetflag ("db"); 1212 memory_below_frame = tgetflag ("db");
1213 TF_hazeltine = tgetflag ("hz"); 1213 TF_hazeltine = tgetflag ("hz");
1214 must_write_spaces = tgetflag ("in"); 1214 must_write_spaces = tgetflag ("in");
1215 meta_key = tgetflag ("km") || tgetflag ("MT"); 1215 meta_key = tgetflag ("km") || tgetflag ("MT");
@@ -1222,13 +1222,13 @@ term_init (terminal_type)
1222 1222
1223 term_get_fkeys (address); 1223 term_get_fkeys (address);
1224 1224
1225 /* Get screen size from system, or else from termcap. */ 1225 /* Get frame size from system, or else from termcap. */
1226 get_screen_size (&SCREEN_WIDTH (selected_screen), 1226 get_frame_size (&FRAME_WIDTH (selected_frame),
1227 &SCREEN_HEIGHT (selected_screen)); 1227 &FRAME_HEIGHT (selected_frame));
1228 if (SCREEN_WIDTH (selected_screen) <= 0) 1228 if (FRAME_WIDTH (selected_frame) <= 0)
1229 SCREEN_WIDTH (selected_screen) = tgetnum ("co"); 1229 FRAME_WIDTH (selected_frame) = tgetnum ("co");
1230 if (SCREEN_HEIGHT (selected_screen) <= 0) 1230 if (FRAME_HEIGHT (selected_frame) <= 0)
1231 SCREEN_HEIGHT (selected_screen) = tgetnum ("li"); 1231 FRAME_HEIGHT (selected_frame) = tgetnum ("li");
1232 1232
1233 min_padding_speed = tgetnum ("pb"); 1233 min_padding_speed = tgetnum ("pb");
1234 TN_standout_width = tgetnum ("sg"); 1234 TN_standout_width = tgetnum ("sg");
@@ -1285,7 +1285,7 @@ term_init (terminal_type)
1285 1285
1286 if (!strcmp (terminal_type, "supdup")) 1286 if (!strcmp (terminal_type, "supdup"))
1287 { 1287 {
1288 memory_below_screen = 1; 1288 memory_below_frame = 1;
1289 Wcm.cm_losewrap = 1; 1289 Wcm.cm_losewrap = 1;
1290 } 1290 }
1291 if (!strncmp (terminal_type, "c10", 3) 1291 if (!strncmp (terminal_type, "c10", 3)
@@ -1296,7 +1296,7 @@ term_init (terminal_type)
1296 for windows starting at the upper left corner; 1296 for windows starting at the upper left corner;
1297 but that is all Emacs uses. 1297 but that is all Emacs uses.
1298 1298
1299 This string works only if the screen is using 1299 This string works only if the frame is using
1300 the top of the video memory, because addressing is memory-relative. 1300 the top of the video memory, because addressing is memory-relative.
1301 So first check the :ti string to see if that is true. 1301 So first check the :ti string to see if that is true.
1302 1302
@@ -1330,9 +1330,9 @@ term_init (terminal_type)
1330 } 1330 }
1331 } 1331 }
1332 1332
1333 ScreenRows = SCREEN_HEIGHT (selected_screen); 1333 FrameRows = FRAME_HEIGHT (selected_frame);
1334 ScreenCols = SCREEN_WIDTH (selected_screen); 1334 FrameCols = FRAME_WIDTH (selected_frame);
1335 specified_window = SCREEN_HEIGHT (selected_screen); 1335 specified_window = FRAME_HEIGHT (selected_frame);
1336 1336
1337 if (Wcm_init () == -1) /* can't do cursor motion */ 1337 if (Wcm_init () == -1) /* can't do cursor motion */
1338#ifdef VMS 1338#ifdef VMS
@@ -1350,9 +1350,9 @@ use the C-shell command `setenv TERM ...' to specify the correct type.\n\
1350It may be necessary to do `unsetenv TERMCAP' as well.\n", 1350It may be necessary to do `unsetenv TERMCAP' as well.\n",
1351 terminal_type); 1351 terminal_type);
1352#endif 1352#endif
1353 if (SCREEN_HEIGHT (selected_screen) <= 0 1353 if (FRAME_HEIGHT (selected_frame) <= 0
1354 || SCREEN_WIDTH (selected_screen) <= 0) 1354 || FRAME_WIDTH (selected_frame) <= 0)
1355 fatal ("The screen size has not been specified."); 1355 fatal ("The frame size has not been specified.");
1356 1356
1357 delete_in_insert_mode 1357 delete_in_insert_mode
1358 = TS_delete_mode && TS_insert_mode 1358 = TS_delete_mode && TS_insert_mode
@@ -1364,7 +1364,7 @@ It may be necessary to do `unsetenv TERMCAP' as well.\n",
1364 1364
1365 /* Remove width of standout marker from usable width of line */ 1365 /* Remove width of standout marker from usable width of line */
1366 if (TN_standout_width > 0) 1366 if (TN_standout_width > 0)
1367 SCREEN_WIDTH (selected_screen) -= TN_standout_width; 1367 FRAME_WIDTH (selected_frame) -= TN_standout_width;
1368 1368
1369 UseTabs = tabs_safe_p () && TabWidth == 8; 1369 UseTabs = tabs_safe_p () && TabWidth == 8;
1370 1370