aboutsummaryrefslogtreecommitdiffstats
path: root/src/xdisp.c
diff options
context:
space:
mode:
authorJim Blandy1992-07-14 15:21:18 +0000
committerJim Blandy1992-07-14 15:21:18 +0000
commit44fa5b1e24d7722ef58d51b3d9fc12ed2b9696fc (patch)
tree9488c9e6ef13c2c26eb13b42b16acbfd14d0ff92 /src/xdisp.c
parentbe14d3120a2502e5f06ef905f3b3e40a62c08d15 (diff)
downloademacs-44fa5b1e24d7722ef58d51b3d9fc12ed2b9696fc.tar.gz
emacs-44fa5b1e24d7722ef58d51b3d9fc12ed2b9696fc.zip
*** empty log message ***
Diffstat (limited to 'src/xdisp.c')
-rw-r--r--src/xdisp.c352
1 files changed, 176 insertions, 176 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 2808c515d47..3b23c489a95 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -23,7 +23,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
23/*#include <ctype.h>*/ 23/*#include <ctype.h>*/
24#undef NULL 24#undef NULL
25#include "lisp.h" 25#include "lisp.h"
26#include "screen.h" 26#include "frame.h"
27#include "window.h" 27#include "window.h"
28#include "termchar.h" 28#include "termchar.h"
29#include "dispextern.h" 29#include "dispextern.h"
@@ -44,18 +44,18 @@ int noninteractive_need_newline;
44#define max(a, b) ((a) > (b) ? (a) : (b)) 44#define max(a, b) ((a) > (b) ? (a) : (b))
45 45
46/* The buffer position of the first character appearing 46/* The buffer position of the first character appearing
47 entirely or partially on the current screen line. 47 entirely or partially on the current frame line.
48 Or zero, which disables the optimization for the current screen line. */ 48 Or zero, which disables the optimization for the current frame line. */
49static int this_line_bufpos; 49static int this_line_bufpos;
50 50
51/* Number of characters past the end of this line, 51/* Number of characters past the end of this line,
52 including the terminating newline */ 52 including the terminating newline */
53static int this_line_endpos; 53static int this_line_endpos;
54 54
55/* The vertical position of this screen line. */ 55/* The vertical position of this frame line. */
56static int this_line_vpos; 56static int this_line_vpos;
57 57
58/* Hpos value for start of display on this screen line. 58/* Hpos value for start of display on this frame line.
59 Usually zero, but negative if first character really began 59 Usually zero, but negative if first character really began
60 on previous line */ 60 on previous line */
61static int this_line_start_hpos; 61static int this_line_start_hpos;
@@ -64,17 +64,17 @@ static int this_line_start_hpos;
64static struct buffer *this_line_buffer; 64static struct buffer *this_line_buffer;
65 65
66/* Set by try_window_id to the vpos of first of any lines 66/* Set by try_window_id to the vpos of first of any lines
67 scrolled on to the bottom of the screen. These lines should 67 scrolled on to the bottom of the frame. These lines should
68 not be included in any general scroll computation. */ 68 not be included in any general scroll computation. */
69static int scroll_bottom_vpos; 69static int scroll_bottom_vpos;
70 70
71/* Value of echo_area_glyphs when it was last acted on. 71/* Value of echo_area_glyphs when it was last acted on.
72 If this is nonzero, there is a message on the screen 72 If this is nonzero, there is a message on the frame
73 in the minibuffer and it should be erased as soon 73 in the minibuffer and it should be erased as soon
74 as it is no longer requested to appear. */ 74 as it is no longer requested to appear. */
75char *previous_echo_glyphs; 75char *previous_echo_glyphs;
76 76
77/* Nonzero means truncate lines in all windows less wide than the screen */ 77/* Nonzero means truncate lines in all windows less wide than the frame */
78int truncate_partial_width_windows; 78int truncate_partial_width_windows;
79 79
80Lisp_Object Vglobal_mode_string; 80Lisp_Object Vglobal_mode_string;
@@ -91,7 +91,7 @@ Lisp_Object last_arrow_position, last_arrow_string;
91/* Nonzero if overlay arrow has been displayed once in this window. */ 91/* Nonzero if overlay arrow has been displayed once in this window. */
92static int overlay_arrow_seen; 92static int overlay_arrow_seen;
93 93
94/* If cursor motion alone moves point off screen, 94/* If cursor motion alone moves point off frame,
95 Try scrolling this many lines up or down if that will bring it back. */ 95 Try scrolling this many lines up or down if that will bring it back. */
96int scroll_step; 96int scroll_step;
97 97
@@ -103,7 +103,7 @@ static int blank_end_of_window;
103 keyboard.c refers to this. */ 103 keyboard.c refers to this. */
104int buffer_shared; 104int buffer_shared;
105 105
106/* display_text_line sets these to the screen position (origin 0) of point, 106/* display_text_line sets these to the frame position (origin 0) of point,
107 whether the window is selected or not. 107 whether the window is selected or not.
108 Set one to -1 first to determine whether point was found afterwards. */ 108 Set one to -1 first to determine whether point was found afterwards. */
109 109
@@ -167,7 +167,7 @@ int clip_changed;
167int windows_or_buffers_changed; 167int windows_or_buffers_changed;
168 168
169 169
170/* Nonzero if SCREEN_MESSAGE_BUF (selected_screen) is being used by print; 170/* Nonzero if FRAME_MESSAGE_BUF (selected_frame) is being used by print;
171 zero if being used by message. */ 171 zero if being used by message. */
172int message_buf_print; 172int message_buf_print;
173 173
@@ -187,14 +187,14 @@ message (m, a1, a2, a3)
187 fprintf (stderr, "\n"); 187 fprintf (stderr, "\n");
188 fflush (stderr); 188 fflush (stderr);
189 } 189 }
190 /* A null message buffer means that the screen hasn't really been 190 /* A null message buffer means that the frame hasn't really been
191 initialized yet. Error messages get reported properly by 191 initialized yet. Error messages get reported properly by
192 cmd_error, so this must be just an informative message; toss it. */ 192 cmd_error, so this must be just an informative message; toss it. */
193 else if (INTERACTIVE && SCREEN_MESSAGE_BUF (selected_screen)) 193 else if (INTERACTIVE && FRAME_MESSAGE_BUF (selected_frame))
194 { 194 {
195#ifdef MULTI_SCREEN 195#ifdef MULTI_FRAME
196 choose_minibuf_screen (); 196 choose_minibuf_frame ();
197 Fmake_screen_visible (WINDOW_SCREEN (XWINDOW (minibuf_window))); 197 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (minibuf_window)));
198#endif 198#endif
199 199
200 { 200 {
@@ -204,15 +204,15 @@ message (m, a1, a2, a3)
204 a[1] = a2; 204 a[1] = a2;
205 a[2] = a3; 205 a[2] = a3;
206 206
207 doprnt (SCREEN_MESSAGE_BUF (selected_screen), 207 doprnt (FRAME_MESSAGE_BUF (selected_frame),
208 SCREEN_WIDTH (selected_screen), m, 0, 3, a); 208 FRAME_WIDTH (selected_frame), m, 0, 3, a);
209#else 209#else
210 doprnt (SCREEN_MESSAGE_BUF (selected_screen), 210 doprnt (FRAME_MESSAGE_BUF (selected_frame),
211 SCREEN_WIDTH (selected_screen), m, 0, 3, &a1); 211 FRAME_WIDTH (selected_frame), m, 0, 3, &a1);
212#endif /* NO_ARG_ARRAY */ 212#endif /* NO_ARG_ARRAY */
213 } 213 }
214 214
215 echo_area_glyphs = SCREEN_MESSAGE_BUF (selected_screen); 215 echo_area_glyphs = FRAME_MESSAGE_BUF (selected_frame);
216 216
217 /* Print should start at the beginning of the message 217 /* Print should start at the beginning of the message
218 buffer next time. */ 218 buffer next time. */
@@ -220,7 +220,7 @@ message (m, a1, a2, a3)
220 220
221 do_pending_window_change (); 221 do_pending_window_change ();
222 echo_area_display (); 222 echo_area_display ();
223 update_screen (XSCREEN (XWINDOW (minibuf_window)->screen), 1, 1); 223 update_frame (XFRAME (XWINDOW (minibuf_window)->frame), 1, 1);
224 do_pending_window_change (); 224 do_pending_window_change ();
225 } 225 }
226} 226}
@@ -238,20 +238,20 @@ message1 (m)
238 fprintf (stderr, "%s\n", m); 238 fprintf (stderr, "%s\n", m);
239 fflush (stderr); 239 fflush (stderr);
240 } 240 }
241 /* A null message buffer means that the screen hasn't really been 241 /* A null message buffer means that the frame hasn't really been
242 initialized yet. Error messages get reported properly by 242 initialized yet. Error messages get reported properly by
243 cmd_error, so this must be just an informative message; toss it. */ 243 cmd_error, so this must be just an informative message; toss it. */
244 else if (INTERACTIVE && SCREEN_MESSAGE_BUF (selected_screen)) 244 else if (INTERACTIVE && FRAME_MESSAGE_BUF (selected_frame))
245 { 245 {
246#ifdef MULTI_SCREEN 246#ifdef MULTI_FRAME
247 choose_minibuf_screen (); 247 choose_minibuf_frame ();
248 Fmake_screen_visible (WINDOW_SCREEN (XWINDOW (minibuf_window))); 248 Fmake_frame_visible (WINDOW_FRAME (XWINDOW (minibuf_window)));
249#endif 249#endif
250 250
251 echo_area_glyphs = m; 251 echo_area_glyphs = m;
252 do_pending_window_change (); 252 do_pending_window_change ();
253 echo_area_display (); 253 echo_area_display ();
254 update_screen (XSCREEN (XWINDOW (minibuf_window)->screen), 1, 1); 254 update_frame (XFRAME (XWINDOW (minibuf_window)->frame), 1, 1);
255 do_pending_window_change (); 255 do_pending_window_change ();
256 } 256 }
257} 257}
@@ -260,33 +260,33 @@ static void
260echo_area_display () 260echo_area_display ()
261{ 261{
262 register int vpos; 262 register int vpos;
263 SCREEN_PTR s; 263 FRAME_PTR f;
264 264
265#ifdef MULTI_SCREEN 265#ifdef MULTI_FRAME
266 choose_minibuf_screen (); 266 choose_minibuf_frame ();
267 s = XSCREEN (WINDOW_SCREEN (XWINDOW (minibuf_window))); 267 f = XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window)));
268 268
269 if (! SCREEN_VISIBLE_P (s)) 269 if (! FRAME_VISIBLE_P (f))
270 return; 270 return;
271#endif 271#endif
272 272
273 if (screen_garbaged) 273 if (frame_garbaged)
274 { 274 {
275 Fredraw_display (); 275 Fredraw_display ();
276 screen_garbaged = 0; 276 frame_garbaged = 0;
277 } 277 }
278 278
279 if (echo_area_glyphs || minibuf_level == 0) 279 if (echo_area_glyphs || minibuf_level == 0)
280 { 280 {
281 vpos = XFASTINT (XWINDOW (minibuf_window)->top); 281 vpos = XFASTINT (XWINDOW (minibuf_window)->top);
282 get_display_line (s, vpos, 0); 282 get_display_line (f, vpos, 0);
283 display_string (XWINDOW (minibuf_window), vpos, 283 display_string (XWINDOW (minibuf_window), vpos,
284 echo_area_glyphs ? echo_area_glyphs : "", 284 echo_area_glyphs ? echo_area_glyphs : "",
285 0, 0, 0, SCREEN_WIDTH (s)); 285 0, 0, 0, FRAME_WIDTH (f));
286 286
287 /* If desired cursor location is on this line, put it at end of text */ 287 /* If desired cursor location is on this line, put it at end of text */
288 if (SCREEN_CURSOR_Y (s) == vpos) 288 if (FRAME_CURSOR_Y (f) == vpos)
289 SCREEN_CURSOR_X (s) = SCREEN_DESIRED_GLYPHS (s)->used[vpos]; 289 FRAME_CURSOR_X (f) = FRAME_DESIRED_GLYPHS (f)->used[vpos];
290 290
291 /* Fill the rest of the minibuffer window with blank lines. */ 291 /* Fill the rest of the minibuffer window with blank lines. */
292 { 292 {
@@ -294,9 +294,9 @@ echo_area_display ()
294 294
295 for (i = vpos + 1; i < vpos + XWINDOW (minibuf_window)->height; i++) 295 for (i = vpos + 1; i < vpos + XWINDOW (minibuf_window)->height; i++)
296 { 296 {
297 get_display_line (s, i, 0); 297 get_display_line (f, i, 0);
298 display_string (XWINDOW (minibuf_window), vpos, 298 display_string (XWINDOW (minibuf_window), vpos,
299 "", 0, 0, 0, SCREEN_WIDTH (s)); 299 "", 0, 0, 0, FRAME_WIDTH (f));
300 } 300 }
301 } 301 }
302 } 302 }
@@ -309,7 +309,7 @@ echo_area_display ()
309 previous_echo_glyphs = echo_area_glyphs; 309 previous_echo_glyphs = echo_area_glyphs;
310} 310}
311 311
312/* Do a screen update, taking possible shortcuts into account. 312/* Do a frame update, taking possible shortcuts into account.
313 This is the main external entry point for redisplay. 313 This is the main external entry point for redisplay.
314 314
315 If the last redisplay displayed an echo area message and that 315 If the last redisplay displayed an echo area message and that
@@ -338,17 +338,17 @@ redisplay ()
338 if (noninteractive) 338 if (noninteractive)
339 return; 339 return;
340 340
341 /* Notice any pending interrupt request to change screen size. */ 341 /* Notice any pending interrupt request to change frame size. */
342 do_pending_window_change (); 342 do_pending_window_change ();
343 343
344 if (screen_garbaged) 344 if (frame_garbaged)
345 { 345 {
346 Fredraw_display (); 346 Fredraw_display ();
347 screen_garbaged = 0; 347 frame_garbaged = 0;
348 } 348 }
349 349
350 /* Normally the message* functions will have already displayed and 350 /* Normally the message* functions will have already displayed and
351 updated the echo area, but the screen may have been trashed, or 351 updated the echo area, but the frame may have been trashed, or
352 the update may have been preempted, so display the echo area 352 the update may have been preempted, so display the echo area
353 again here. */ 353 again here. */
354 if (echo_area_glyphs || previous_echo_glyphs) 354 if (echo_area_glyphs || previous_echo_glyphs)
@@ -369,7 +369,7 @@ redisplay ()
369 update_mode_lines++; 369 update_mode_lines++;
370 } 370 }
371 371
372 SCREEN_SCROLL_BOTTOM_VPOS (XSCREEN (w->screen)) = -1; 372 FRAME_SCROLL_BOTTOM_VPOS (XFRAME (w->frame)) = -1;
373 373
374 all_windows = update_mode_lines || buffer_shared > 1; 374 all_windows = update_mode_lines || buffer_shared > 1;
375 375
@@ -382,7 +382,7 @@ redisplay ()
382 tlbufpos = this_line_bufpos; 382 tlbufpos = this_line_bufpos;
383 tlendpos = this_line_endpos; 383 tlendpos = this_line_endpos;
384 if (!all_windows && tlbufpos > 0 && NILP (w->update_mode_line) 384 if (!all_windows && tlbufpos > 0 && NILP (w->update_mode_line)
385 && SCREEN_VISIBLE_P (XSCREEN (w->screen)) 385 && FRAME_VISIBLE_P (XFRAME (w->frame))
386 /* Make sure recorded data applies to current buffer, etc */ 386 /* Make sure recorded data applies to current buffer, etc */
387 && this_line_buffer == current_buffer 387 && this_line_buffer == current_buffer
388 && current_buffer == XBUFFER (w->buffer) 388 && current_buffer == XBUFFER (w->buffer)
@@ -422,7 +422,7 @@ redisplay ()
422 if (cursor_vpos >= 0 && this_line_bufpos 422 if (cursor_vpos >= 0 && this_line_bufpos
423 && this_line_endpos == tlendpos) 423 && this_line_endpos == tlendpos)
424 { 424 {
425 if (XFASTINT (w->width) != SCREEN_WIDTH (XSCREEN (WINDOW_SCREEN (w)))) 425 if (XFASTINT (w->width) != FRAME_WIDTH (XFRAME (WINDOW_FRAME (w))))
426 preserve_other_columns (w); 426 preserve_other_columns (w);
427 goto update; 427 goto update;
428 } 428 }
@@ -445,14 +445,14 @@ redisplay ()
445 point, 2, - (1 << (SHORTBITS - 1)), 445 point, 2, - (1 << (SHORTBITS - 1)),
446 XFASTINT (w->width) - 1 446 XFASTINT (w->width) - 1
447 - (XFASTINT (w->width) + XFASTINT (w->left) 447 - (XFASTINT (w->width) + XFASTINT (w->left)
448 != SCREEN_WIDTH (selected_screen)), 448 != FRAME_WIDTH (selected_frame)),
449 XINT (w->hscroll), 449 XINT (w->hscroll),
450 pos_tab_offset (w, tlbufpos)); 450 pos_tab_offset (w, tlbufpos));
451 if (pos.vpos < 1) 451 if (pos.vpos < 1)
452 { 452 {
453 SCREEN_CURSOR_X (selected_screen) 453 FRAME_CURSOR_X (selected_frame)
454 = XFASTINT (w->left) + max (pos.hpos, 0); 454 = XFASTINT (w->left) + max (pos.hpos, 0);
455 SCREEN_CURSOR_Y (selected_screen) = this_line_vpos; 455 FRAME_CURSOR_Y (selected_frame) = this_line_vpos;
456 goto update; 456 goto update;
457 } 457 }
458 else 458 else
@@ -460,7 +460,7 @@ redisplay ()
460 } 460 }
461 cancel: 461 cancel:
462 /* Text changed drastically or point moved off of line */ 462 /* Text changed drastically or point moved off of line */
463 cancel_line (this_line_vpos, selected_screen); 463 cancel_line (this_line_vpos, selected_frame);
464 } 464 }
465 465
466 this_line_bufpos = 0; 466 this_line_bufpos = 0;
@@ -468,33 +468,33 @@ redisplay ()
468 468
469 if (all_windows) 469 if (all_windows)
470 { 470 {
471#ifdef MULTI_SCREEN 471#ifdef MULTI_FRAME
472 Lisp_Object tail; 472 Lisp_Object tail;
473 473
474 /* Recompute # windows showing selected buffer. 474 /* Recompute # windows showing selected buffer.
475 This will be incremented each time such a window is displayed. */ 475 This will be incremented each time such a window is displayed. */
476 buffer_shared = 0; 476 buffer_shared = 0;
477 477
478 for (tail = Vscreen_list; CONSP (tail); tail = XCONS (tail)->cdr) 478 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
479 { 479 {
480 SCREEN_PTR s; 480 FRAME_PTR f;
481 481
482 if (XTYPE (XCONS (tail)->car) != Lisp_Screen) 482 if (XTYPE (XCONS (tail)->car) != Lisp_Frame)
483 continue; 483 continue;
484 484
485 s = XSCREEN (XCONS (tail)->car); 485 f = XFRAME (XCONS (tail)->car);
486 if (s->visible) 486 if (f->visible)
487 /* Redraw its windows. */ 487 /* Redraw its windows. */
488 redisplay_windows (SCREEN_ROOT_WINDOW (s)); 488 redisplay_windows (FRAME_ROOT_WINDOW (f));
489 } 489 }
490#else 490#else
491 redisplay_windows (SCREEN_ROOT_WINDOW (s)); 491 redisplay_windows (FRAME_ROOT_WINDOW (f));
492#endif /* not MULTI_SCREEN */ 492#endif /* not MULTI_FRAME */
493 } 493 }
494 else if (SCREEN_VISIBLE_P (selected_screen)) 494 else if (FRAME_VISIBLE_P (selected_frame))
495 { 495 {
496 redisplay_window (selected_window, 1); 496 redisplay_window (selected_window, 1);
497 if (XFASTINT (w->width) != SCREEN_WIDTH (selected_screen)) 497 if (XFASTINT (w->width) != FRAME_WIDTH (selected_frame))
498 preserve_other_columns (w); 498 preserve_other_columns (w);
499 } 499 }
500 500
@@ -506,51 +506,51 @@ update:
506 unrequest_sigio (); 506 unrequest_sigio ();
507 stop_polling (); 507 stop_polling ();
508 508
509#ifdef MULTI_SCREEN 509#ifdef MULTI_FRAME
510 if (all_windows) 510 if (all_windows)
511 { 511 {
512 Lisp_Object tail; 512 Lisp_Object tail;
513 513
514 pause = 0; 514 pause = 0;
515 515
516 for (tail = Vscreen_list; CONSP (tail); tail = XCONS (tail)->cdr) 516 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
517 { 517 {
518 SCREEN_PTR s; 518 FRAME_PTR f;
519 519
520 if (XTYPE (XCONS (tail)->car) != Lisp_Screen) 520 if (XTYPE (XCONS (tail)->car) != Lisp_Frame)
521 continue; 521 continue;
522 522
523 s = XSCREEN (XCONS (tail)->car); 523 f = XFRAME (XCONS (tail)->car);
524 if (s->visible) 524 if (f->visible)
525 { 525 {
526 pause |= update_screen (s, 0, 0); 526 pause |= update_frame (f, 0, 0);
527 if (!pause) 527 if (!pause)
528 mark_window_display_accurate (s->root_window, 1); 528 mark_window_display_accurate (f->root_window, 1);
529 } 529 }
530 } 530 }
531 } 531 }
532 else 532 else
533#endif /* MULTI_SCREEN */ 533#endif /* MULTI_FRAME */
534 { 534 {
535 if (SCREEN_VISIBLE_P (selected_screen)) 535 if (FRAME_VISIBLE_P (selected_frame))
536 pause = update_screen (selected_screen, 0, 0); 536 pause = update_frame (selected_frame, 0, 0);
537#ifdef MULTI_SCREEN 537#ifdef MULTI_FRAME
538 /* We may have called echo_area_display at the top of this 538 /* We may have called echo_area_display at the top of this
539 function. If the echo area is on another screen, that may 539 function. If the echo area is on another frame, that may
540 have put text on a screen other than the selected one, so the 540 have put text on a frame other than the selected one, so the
541 above call to update_screen would not have caught it. Catch 541 above call to update_frame would not have caught it. Catch
542 it here. */ 542 it here. */
543 { 543 {
544 SCREEN_PTR mini_screen = 544 FRAME_PTR mini_frame =
545 XSCREEN (WINDOW_SCREEN (XWINDOW (minibuf_window))); 545 XFRAME (WINDOW_FRAME (XWINDOW (minibuf_window)));
546 546
547 if (mini_screen != selected_screen) 547 if (mini_frame != selected_frame)
548 pause |= update_screen (mini_screen, 0, 0); 548 pause |= update_frame (mini_frame, 0, 0);
549 } 549 }
550#endif 550#endif
551 } 551 }
552 552
553 /* If screen does not match, prevent doing single-line-update next time. 553 /* If frame does not match, prevent doing single-line-update next time.
554 Also, don't forget to check every line to update the arrow. */ 554 Also, don't forget to check every line to update the arrow. */
555 if (pause) 555 if (pause)
556 { 556 {
@@ -560,15 +560,15 @@ update:
560 last_arrow_position = Qt; 560 last_arrow_position = Qt;
561 last_arrow_string = Qt; 561 last_arrow_string = Qt;
562 } 562 }
563 /* If we pause after scrolling, some lines in current_screen 563 /* If we pause after scrolling, some lines in current_frame
564 may be null, so preserve_other_columns won't be able to 564 may be null, so preserve_other_columns won't be able to
565 preserve all the vertical-bar separators. So, avoid using it 565 preserve all the vertical-bar separators. So, avoid using it
566 in that case. */ 566 in that case. */
567 if (XFASTINT (w->width) != SCREEN_WIDTH (selected_screen)) 567 if (XFASTINT (w->width) != FRAME_WIDTH (selected_frame))
568 update_mode_lines = 1; 568 update_mode_lines = 1;
569 } 569 }
570 570
571 /* Now text on screen agrees with windows, so 571 /* Now text on frame agrees with windows, so
572 put info into the windows for partial redisplay to follow */ 572 put info into the windows for partial redisplay to follow */
573 573
574 if (!pause) 574 if (!pause)
@@ -582,8 +582,8 @@ update:
582 end_unchanged = BUF_Z (b) - BUF_GPT (b); 582 end_unchanged = BUF_Z (b) - BUF_GPT (b);
583 583
584 XFASTINT (w->last_point) = BUF_PT (b); 584 XFASTINT (w->last_point) = BUF_PT (b);
585 XFASTINT (w->last_point_x) = SCREEN_CURSOR_X (selected_screen); 585 XFASTINT (w->last_point_x) = FRAME_CURSOR_X (selected_frame);
586 XFASTINT (w->last_point_y) = SCREEN_CURSOR_Y (selected_screen); 586 XFASTINT (w->last_point_y) = FRAME_CURSOR_Y (selected_frame);
587 587
588 if (all_windows) 588 if (all_windows)
589 mark_window_display_accurate (XWINDOW (minibuf_window)->prev, 1); 589 mark_window_display_accurate (XWINDOW (minibuf_window)->prev, 1);
@@ -610,7 +610,7 @@ update:
610 request_sigio (); 610 request_sigio ();
611 start_polling (); 611 start_polling ();
612 612
613 /* Change screen size now if a change is pending. */ 613 /* Change frame size now if a change is pending. */
614 do_pending_window_change (); 614 do_pending_window_change ();
615} 615}
616 616
@@ -688,13 +688,13 @@ redisplay_window (window, just_this_one)
688 int just_this_one; 688 int just_this_one;
689{ 689{
690 register struct window *w = XWINDOW (window); 690 register struct window *w = XWINDOW (window);
691 SCREEN_PTR s = XSCREEN (w->screen); 691 FRAME_PTR f = XFRAME (w->frame);
692 int height; 692 int height;
693 register int lpoint = point; 693 register int lpoint = point;
694 struct buffer *old = current_buffer; 694 struct buffer *old = current_buffer;
695 register int width = XFASTINT (w->width) - 1 695 register int width = XFASTINT (w->width) - 1
696 - (XFASTINT (w->width) + XFASTINT (w->left) 696 - (XFASTINT (w->width) + XFASTINT (w->left)
697 != SCREEN_WIDTH (XSCREEN (WINDOW_SCREEN (w)))); 697 != FRAME_WIDTH (XFRAME (WINDOW_FRAME (w))));
698 register int startp; 698 register int startp;
699 register int hscroll = XINT (w->hscroll); 699 register int hscroll = XINT (w->hscroll);
700 struct position pos; 700 struct position pos;
@@ -702,7 +702,7 @@ redisplay_window (window, just_this_one)
702 int tem; 702 int tem;
703 int window_needs_modeline; 703 int window_needs_modeline;
704 704
705 if (SCREEN_HEIGHT (s) == 0) abort (); /* Some bug zeros some core */ 705 if (FRAME_HEIGHT (f) == 0) abort (); /* Some bug zeros some core */
706 706
707 /* If this is a combination window, do its children; that's all. */ 707 /* If this is a combination window, do its children; that's all. */
708 708
@@ -733,12 +733,12 @@ redisplay_window (window, just_this_one)
733 { 733 {
734 /* This is a minibuffer, but it's not the currently active one, so 734 /* This is a minibuffer, but it's not the currently active one, so
735 clear it. */ 735 clear it. */
736 int vpos = XFASTINT (XWINDOW (SCREEN_MINIBUF_WINDOW (s))->top); 736 int vpos = XFASTINT (XWINDOW (FRAME_MINIBUF_WINDOW (f))->top);
737 int i; 737 int i;
738 738
739 for (i = 0; i < height; i++) 739 for (i = 0; i < height; i++)
740 { 740 {
741 get_display_line (s, vpos + i, 0); 741 get_display_line (f, vpos + i, 0);
742 display_string (w, vpos + i, "", 0, 0, 0, width); 742 display_string (w, vpos + i, "", 0, 0, 0, width);
743 } 743 }
744 744
@@ -806,20 +806,20 @@ redisplay_window (window, just_this_one)
806 - (1 << (SHORTBITS - 1)), 806 - (1 << (SHORTBITS - 1)),
807 width, hscroll, pos_tab_offset (w, startp)); 807 width, hscroll, pos_tab_offset (w, startp));
808 SET_PT (pos.bufpos); 808 SET_PT (pos.bufpos);
809 if (w != XWINDOW (SCREEN_SELECTED_WINDOW (s))) 809 if (w != XWINDOW (FRAME_SELECTED_WINDOW (f)))
810 Fset_marker (w->pointm, make_number (point), Qnil); 810 Fset_marker (w->pointm, make_number (point), Qnil);
811 else 811 else
812 { 812 {
813 lpoint = point; 813 lpoint = point;
814 SCREEN_CURSOR_X (s) = max (0, pos.hpos) + XFASTINT (w->left); 814 FRAME_CURSOR_X (f) = max (0, pos.hpos) + XFASTINT (w->left);
815 SCREEN_CURSOR_Y (s) = pos.vpos + XFASTINT (w->top); 815 FRAME_CURSOR_Y (f) = pos.vpos + XFASTINT (w->top);
816 } 816 }
817 } 817 }
818 goto done; 818 goto done;
819 } 819 }
820 820
821 /* Handle case where text has not changed, only point, 821 /* Handle case where text has not changed, only point,
822 and it has not moved off the screen */ 822 and it has not moved off the frame */
823 823
824 /* This code is not used for minibuffer for the sake of 824 /* This code is not used for minibuffer for the sake of
825 the case of redisplaying to replace an echo area message; 825 the case of redisplaying to replace an echo area message;
@@ -830,7 +830,7 @@ redisplay_window (window, just_this_one)
830 830
831 if (XFASTINT (w->last_modified) >= MODIFF 831 if (XFASTINT (w->last_modified) >= MODIFF
832 && point >= startp && !clip_changed 832 && point >= startp && !clip_changed
833 && (just_this_one || XFASTINT (w->width) == SCREEN_WIDTH (s)) 833 && (just_this_one || XFASTINT (w->width) == FRAME_WIDTH (f))
834 && !EQ (window, minibuf_window)) 834 && !EQ (window, minibuf_window))
835 { 835 {
836 pos = *compute_motion (startp, 0, (hscroll ? 1 - hscroll : 0), 836 pos = *compute_motion (startp, 0, (hscroll ? 1 - hscroll : 0),
@@ -839,18 +839,18 @@ redisplay_window (window, just_this_one)
839 839
840 if (pos.vpos < height) 840 if (pos.vpos < height)
841 { 841 {
842 /* Ok, point is still on screen */ 842 /* Ok, point is still on frame */
843 if (w == XWINDOW (SCREEN_SELECTED_WINDOW (s))) 843 if (w == XWINDOW (FRAME_SELECTED_WINDOW (f)))
844 { 844 {
845 /* These variables are supposed to be origin 1 */ 845 /* These variables are supposed to be origin 1 */
846 SCREEN_CURSOR_X (s) = max (0, pos.hpos) + XFASTINT (w->left); 846 FRAME_CURSOR_X (f) = max (0, pos.hpos) + XFASTINT (w->left);
847 SCREEN_CURSOR_Y (s) = pos.vpos + XFASTINT (w->top); 847 FRAME_CURSOR_Y (f) = pos.vpos + XFASTINT (w->top);
848 } 848 }
849 /* This doesn't do the trick, because if a window to the right of 849 /* This doesn't do the trick, because if a window to the right of
850 this one must be redisplayed, this does nothing because there 850 this one must be redisplayed, this does nothing because there
851 is nothing in DesiredScreen yet, and then the other window is 851 is nothing in DesiredFrame yet, and then the other window is
852 redisplayed, making likes that are empty in this window's columns. 852 redisplayed, making likes that are empty in this window's columns.
853 if (XFASTINT (w->width) != SCREEN_WIDTH (s)) 853 if (XFASTINT (w->width) != FRAME_WIDTH (f))
854 preserve_my_columns (w); 854 preserve_my_columns (w);
855 */ 855 */
856 goto done; 856 goto done;
@@ -872,10 +872,10 @@ redisplay_window (window, just_this_one)
872 && ! EQ (w->window_end_valid, Qnil) 872 && ! EQ (w->window_end_valid, Qnil)
873 && do_id && !clip_changed 873 && do_id && !clip_changed
874 && !blank_end_of_window 874 && !blank_end_of_window
875 && XFASTINT (w->width) == SCREEN_WIDTH (s) 875 && XFASTINT (w->width) == FRAME_WIDTH (f)
876 && EQ (last_arrow_position, Voverlay_arrow_position) 876 && EQ (last_arrow_position, Voverlay_arrow_position)
877 && EQ (last_arrow_string, Voverlay_arrow_string) 877 && EQ (last_arrow_string, Voverlay_arrow_string)
878 && (tem = try_window_id (SCREEN_SELECTED_WINDOW (s))) 878 && (tem = try_window_id (FRAME_SELECTED_WINDOW (f)))
879 && tem != -2) 879 && tem != -2)
880 { 880 {
881 /* tem > 0 means success. tem == -1 means choose new start. 881 /* tem > 0 means success. tem == -1 means choose new start.
@@ -891,7 +891,7 @@ redisplay_window (window, just_this_one)
891 || (XFASTINT (w->last_modified) >= MODIFF))) 891 || (XFASTINT (w->last_modified) >= MODIFF)))
892 { 892 {
893 /* Try to redisplay starting at same place as before */ 893 /* Try to redisplay starting at same place as before */
894 /* If point has not moved off screen, accept the results */ 894 /* If point has not moved off frame, accept the results */
895 try_window (window, startp); 895 try_window (window, startp);
896 if (cursor_vpos >= 0) 896 if (cursor_vpos >= 0)
897 goto done; 897 goto done;
@@ -942,7 +942,7 @@ done:
942 /* If window not full width, must redo its mode line 942 /* If window not full width, must redo its mode line
943 if the window to its side is being redone */ 943 if the window to its side is being redone */
944 if ((!NILP (w->update_mode_line) 944 if ((!NILP (w->update_mode_line)
945 || (!just_this_one && width < SCREEN_WIDTH (s) - 1)) 945 || (!just_this_one && width < FRAME_WIDTH (f) - 1))
946 && height != XFASTINT (w->height)) 946 && height != XFASTINT (w->height))
947 display_mode_line (w); 947 display_mode_line (w);
948 948
@@ -963,9 +963,9 @@ try_window (window, pos)
963 register int vpos = XFASTINT (w->top); 963 register int vpos = XFASTINT (w->top);
964 register int last_text_vpos = vpos; 964 register int last_text_vpos = vpos;
965 int tab_offset = pos_tab_offset (w, pos); 965 int tab_offset = pos_tab_offset (w, pos);
966 SCREEN_PTR s = XSCREEN (w->screen); 966 FRAME_PTR f = XFRAME (w->frame);
967 int width = XFASTINT (w->width) - 1 967 int width = XFASTINT (w->width) - 1
968 - (XFASTINT (w->width) + XFASTINT (w->left) != SCREEN_WIDTH (s)); 968 - (XFASTINT (w->width) + XFASTINT (w->left) != FRAME_WIDTH (f));
969 struct position val; 969 struct position val;
970 970
971 Fset_marker (w->start, make_number (pos), Qnil); 971 Fset_marker (w->start, make_number (pos), Qnil);
@@ -987,16 +987,16 @@ try_window (window, pos)
987 } 987 }
988 988
989 /* If last line is continued in middle of character, 989 /* If last line is continued in middle of character,
990 include the split character in the text considered on the screen */ 990 include the split character in the text considered on the frame */
991 if (val.hpos < (XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0)) 991 if (val.hpos < (XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0))
992 pos++; 992 pos++;
993 993
994 /* If bottom just moved off end of screen, change mode line percentage. */ 994 /* If bottom just moved off end of frame, change mode line percentage. */
995 if (XFASTINT (w->window_end_pos) == 0 995 if (XFASTINT (w->window_end_pos) == 0
996 && Z != pos) 996 && Z != pos)
997 w->update_mode_line = Qt; 997 w->update_mode_line = Qt;
998 998
999 /* Say where last char on screen will be, once redisplay is finished. */ 999 /* Say where last char on frame will be, once redisplay is finished. */
1000 XFASTINT (w->window_end_pos) = Z - pos; 1000 XFASTINT (w->window_end_pos) = Z - pos;
1001 XFASTINT (w->window_end_vpos) = last_text_vpos - XFASTINT (w->top); 1001 XFASTINT (w->window_end_vpos) = last_text_vpos - XFASTINT (w->top);
1002 /* But that is not valid info until redisplay finishes. */ 1002 /* But that is not valid info until redisplay finishes. */
@@ -1017,11 +1017,11 @@ try_window_id (window)
1017 int pos; 1017 int pos;
1018 register struct window *w = XWINDOW (window); 1018 register struct window *w = XWINDOW (window);
1019 register int height = window_internal_height (w); 1019 register int height = window_internal_height (w);
1020 SCREEN_PTR s = XSCREEN (w->screen); 1020 FRAME_PTR f = XFRAME (w->frame);
1021 int top = XFASTINT (w->top); 1021 int top = XFASTINT (w->top);
1022 int start = marker_position (w->start); 1022 int start = marker_position (w->start);
1023 int width = XFASTINT (w->width) - 1 1023 int width = XFASTINT (w->width) - 1
1024 - (XFASTINT (w->width) + XFASTINT (w->left) != SCREEN_WIDTH (s)); 1024 - (XFASTINT (w->width) + XFASTINT (w->left) != FRAME_WIDTH (f));
1025 int hscroll = XINT (w->hscroll); 1025 int hscroll = XINT (w->hscroll);
1026 int lmargin = hscroll > 0 ? 1 - hscroll : 0; 1026 int lmargin = hscroll > 0 ? 1 - hscroll : 0;
1027 register int vpos; 1027 register int vpos;
@@ -1050,8 +1050,8 @@ try_window_id (window)
1050 { 1050 {
1051 if (point < bp.bufpos && !bp.contin) 1051 if (point < bp.bufpos && !bp.contin)
1052 { 1052 {
1053 /* All changes are below the screen, and point is on the screen. 1053 /* All changes are below the frame, and point is on the frame.
1054 We don't need to change the screen at all. 1054 We don't need to change the frame at all.
1055 But we need to update window_end_pos to account for 1055 But we need to update window_end_pos to account for
1056 any change in buffer size. */ 1056 any change in buffer size. */
1057 bp = *compute_motion (start, 0, lmargin, 1057 bp = *compute_motion (start, 0, lmargin,
@@ -1066,7 +1066,7 @@ try_window_id (window)
1066 1066
1067 vpos = bp.vpos; 1067 vpos = bp.vpos;
1068 1068
1069 /* Find beginning of that screen line. Must display from there. */ 1069 /* Find beginning of that frame line. Must display from there. */
1070 bp = *vmotion (bp.bufpos, 0, width, hscroll, window); 1070 bp = *vmotion (bp.bufpos, 0, width, hscroll, window);
1071 1071
1072 pos = bp.bufpos; 1072 pos = bp.bufpos;
@@ -1075,7 +1075,7 @@ try_window_id (window)
1075 return -1; 1075 return -1;
1076 1076
1077 /* If about to start displaying at the beginning of a continuation line, 1077 /* If about to start displaying at the beginning of a continuation line,
1078 really start with previous screen line, in case it was not 1078 really start with previous frame line, in case it was not
1079 continued when last redisplayed */ 1079 continued when last redisplayed */
1080 if ((bp.contin && bp.bufpos - 1 == beg_unchanged && vpos > 0) 1080 if ((bp.contin && bp.bufpos - 1 == beg_unchanged && vpos > 0)
1081 || 1081 ||
@@ -1111,8 +1111,8 @@ try_window_id (window)
1111 height, - (1 << (SHORTBITS - 1)), 1111 height, - (1 << (SHORTBITS - 1)),
1112 width, hscroll, pos_tab_offset (w, bp.bufpos)); 1112 width, hscroll, pos_tab_offset (w, bp.bufpos));
1113 1113
1114 /* If changes reach past the text available on the screen, 1114 /* If changes reach past the text available on the frame,
1115 just display rest of screen. */ 1115 just display rest of frame. */
1116 if (ep.bufpos > Z - XFASTINT (w->window_end_pos)) 1116 if (ep.bufpos > Z - XFASTINT (w->window_end_pos))
1117 stop_vpos = height; 1117 stop_vpos = height;
1118 else 1118 else
@@ -1143,7 +1143,7 @@ try_window_id (window)
1143 10000, 0, width, hscroll, epto); 1143 10000, 0, width, hscroll, epto);
1144 scroll_amount = xp.vpos - XFASTINT (w->window_end_vpos); 1144 scroll_amount = xp.vpos - XFASTINT (w->window_end_vpos);
1145 1145
1146 /* Is everything on screen below the changes whitespace? 1146 /* Is everything on frame below the changes whitespace?
1147 If so, no scrolling is really necessary. */ 1147 If so, no scrolling is really necessary. */
1148 for (i = ep.bufpos; i < xp.bufpos; i++) 1148 for (i = ep.bufpos; i < xp.bufpos; i++)
1149 { 1149 {
@@ -1156,7 +1156,7 @@ try_window_id (window)
1156 1156
1157 XFASTINT (w->window_end_vpos) += scroll_amount; 1157 XFASTINT (w->window_end_vpos) += scroll_amount;
1158 1158
1159 /* Before doing any scrolling, verify that point will be on screen. */ 1159 /* Before doing any scrolling, verify that point will be on frame. */
1160 if (point > ep.bufpos && !(point <= xp.bufpos && xp.bufpos < height)) 1160 if (point > ep.bufpos && !(point <= xp.bufpos && xp.bufpos < height))
1161 { 1161 {
1162 if (point <= xp.bufpos) 1162 if (point <= xp.bufpos)
@@ -1186,9 +1186,9 @@ try_window_id (window)
1186 /* In this path, we have altered window_end_vpos 1186 /* In this path, we have altered window_end_vpos
1187 and not left it negative. 1187 and not left it negative.
1188 We must make sure that, in case display is preempted 1188 We must make sure that, in case display is preempted
1189 before the screen changes to reflect what we do here, 1189 before the frame changes to reflect what we do here,
1190 further updates will not come to try_window_id 1190 further updates will not come to try_window_id
1191 and assume the screen and window_end_vpos match. */ 1191 and assume the frame and window_end_vpos match. */
1192 blank_end_of_window = 1; 1192 blank_end_of_window = 1;
1193 } 1193 }
1194 else if (!scroll_amount) 1194 else if (!scroll_amount)
@@ -1197,7 +1197,7 @@ try_window_id (window)
1197 { 1197 {
1198 /* If reprinting everything is nearly as fast as scrolling, 1198 /* If reprinting everything is nearly as fast as scrolling,
1199 don't bother scrolling. Can happen if lines are short. */ 1199 don't bother scrolling. Can happen if lines are short. */
1200 if (scroll_cost (s, bp.vpos + top - scroll_amount, 1200 if (scroll_cost (f, bp.vpos + top - scroll_amount,
1201 top + height - max (0, scroll_amount), 1201 top + height - max (0, scroll_amount),
1202 scroll_amount) 1202 scroll_amount)
1203 > xp.bufpos - bp.bufpos - 20) 1203 > xp.bufpos - bp.bufpos - 20)
@@ -1208,7 +1208,7 @@ try_window_id (window)
1208 In common case of killing a line, this can save the 1208 In common case of killing a line, this can save the
1209 following line from being overwritten by scrolling 1209 following line from being overwritten by scrolling
1210 and therefore having to be redrawn. */ 1210 and therefore having to be redrawn. */
1211 tem = scroll_screen_lines (s, bp.vpos + top - scroll_amount, 1211 tem = scroll_frame_lines (f, bp.vpos + top - scroll_amount,
1212 top + height - max (0, scroll_amount), 1212 top + height - max (0, scroll_amount),
1213 scroll_amount); 1213 scroll_amount);
1214 if (!tem) stop_vpos = height; 1214 if (!tem) stop_vpos = height;
@@ -1220,14 +1220,14 @@ try_window_id (window)
1220 /* Note that if scroll_amount > 0, xp.bufpos - bp.bufpos is an 1220 /* Note that if scroll_amount > 0, xp.bufpos - bp.bufpos is an
1221 overestimate of cost of reprinting, since xp.bufpos 1221 overestimate of cost of reprinting, since xp.bufpos
1222 would end up below the bottom of the window. */ 1222 would end up below the bottom of the window. */
1223 if (scroll_cost (s, ep.vpos + top - scroll_amount, 1223 if (scroll_cost (f, ep.vpos + top - scroll_amount,
1224 top + height - max (0, scroll_amount), 1224 top + height - max (0, scroll_amount),
1225 scroll_amount) 1225 scroll_amount)
1226 > xp.bufpos - ep.bufpos - 20) 1226 > xp.bufpos - ep.bufpos - 20)
1227 /* Return "try normal display with same window-start." 1227 /* Return "try normal display with same window-start."
1228 Too bad we can't prevent further scroll-thinking. */ 1228 Too bad we can't prevent further scroll-thinking. */
1229 return -2; 1229 return -2;
1230 tem = scroll_screen_lines (s, ep.vpos + top - scroll_amount, 1230 tem = scroll_frame_lines (f, ep.vpos + top - scroll_amount,
1231 top + height - max (0, scroll_amount), 1231 top + height - max (0, scroll_amount),
1232 scroll_amount); 1232 scroll_amount);
1233 if (!tem) stop_vpos = height; 1233 if (!tem) stop_vpos = height;
@@ -1272,7 +1272,7 @@ try_window_id (window)
1272 if (vpos == height) 1272 if (vpos == height)
1273 { 1273 {
1274 /* If last line is continued in middle of character, 1274 /* If last line is continued in middle of character,
1275 include the split character in the text considered on the screen */ 1275 include the split character in the text considered on the frame */
1276 if (val.hpos < lmargin) 1276 if (val.hpos < lmargin)
1277 val.bufpos++; 1277 val.bufpos++;
1278 XFASTINT (w->window_end_vpos) = last_text_vpos; 1278 XFASTINT (w->window_end_vpos) = last_text_vpos;
@@ -1285,7 +1285,7 @@ try_window_id (window)
1285 { 1285 {
1286 /* Don't consider these lines for general-purpose scrolling. 1286 /* Don't consider these lines for general-purpose scrolling.
1287 That will save time in the scrolling computation. */ 1287 That will save time in the scrolling computation. */
1288 SCREEN_SCROLL_BOTTOM_VPOS (s) = xp.vpos; 1288 FRAME_SCROLL_BOTTOM_VPOS (f) = xp.vpos;
1289 vpos = xp.vpos; 1289 vpos = xp.vpos;
1290 pos = xp.bufpos; 1290 pos = xp.bufpos;
1291 val.hpos = lmargin; 1291 val.hpos = lmargin;
@@ -1319,7 +1319,7 @@ try_window_id (window)
1319 cursor_vpos = -1; 1319 cursor_vpos = -1;
1320 } 1320 }
1321 1321
1322 /* If bottom just moved off end of screen, change mode line percentage. */ 1322 /* If bottom just moved off end of frame, change mode line percentage. */
1323 if (XFASTINT (w->window_end_pos) == 0 1323 if (XFASTINT (w->window_end_pos) == 0
1324 && Z != val.bufpos) 1324 && Z != val.bufpos)
1325 w->update_mode_line = Qt; 1325 w->update_mode_line = Qt;
@@ -1346,19 +1346,19 @@ try_window_id (window)
1346 { 1346 {
1347 val = *compute_motion (start, 0, lmargin, point, 10000, 10000, 1347 val = *compute_motion (start, 0, lmargin, point, 10000, 10000,
1348 width, hscroll, pos_tab_offset (w, start)); 1348 width, hscroll, pos_tab_offset (w, start));
1349 /* Admit failure if point is off screen now */ 1349 /* Admit failure if point is off frame now */
1350 if (val.vpos >= height) 1350 if (val.vpos >= height)
1351 { 1351 {
1352 for (vpos = 0; vpos < height; vpos++) 1352 for (vpos = 0; vpos < height; vpos++)
1353 cancel_line (vpos + top, s); 1353 cancel_line (vpos + top, f);
1354 return 0; 1354 return 0;
1355 } 1355 }
1356 cursor_vpos = val.vpos + top; 1356 cursor_vpos = val.vpos + top;
1357 cursor_hpos = val.hpos + XFASTINT (w->left); 1357 cursor_hpos = val.hpos + XFASTINT (w->left);
1358 } 1358 }
1359 1359
1360 SCREEN_CURSOR_X (s) = max (0, cursor_hpos); 1360 FRAME_CURSOR_X (f) = max (0, cursor_hpos);
1361 SCREEN_CURSOR_Y (s) = cursor_vpos; 1361 FRAME_CURSOR_Y (f) = cursor_vpos;
1362 1362
1363 if (debug_end_pos) 1363 if (debug_end_pos)
1364 { 1364 {
@@ -1408,7 +1408,7 @@ copy_rope (t, s, from)
1408 1408
1409 TABOFFSET is an offset for ostensible hpos, used in tab stop calculations. 1409 TABOFFSET is an offset for ostensible hpos, used in tab stop calculations.
1410 1410
1411 Display on position VPOS on the screen. (origin 0). 1411 Display on position VPOS on the frame. (origin 0).
1412 1412
1413 Returns a STRUCT POSITION giving character to start next line with 1413 Returns a STRUCT POSITION giving character to start next line with
1414 and where to display it, including a zero or negative hpos. 1414 and where to display it, including a zero or negative hpos.
@@ -1433,18 +1433,18 @@ display_text_line (w, start, vpos, hpos, taboffset)
1433 GLYPH *endp; 1433 GLYPH *endp;
1434 register GLYPH *startp; 1434 register GLYPH *startp;
1435 register GLYPH *p1prev; 1435 register GLYPH *p1prev;
1436 SCREEN_PTR s = XSCREEN (w->screen); 1436 FRAME_PTR f = XFRAME (w->frame);
1437 int tab_width = XINT (current_buffer->tab_width); 1437 int tab_width = XINT (current_buffer->tab_width);
1438 int ctl_arrow = !NILP (current_buffer->ctl_arrow); 1438 int ctl_arrow = !NILP (current_buffer->ctl_arrow);
1439 int width = XFASTINT (w->width) - 1 1439 int width = XFASTINT (w->width) - 1
1440 - (XFASTINT (w->width) + XFASTINT (w->left) != SCREEN_WIDTH (s)); 1440 - (XFASTINT (w->width) + XFASTINT (w->left) != FRAME_WIDTH (f));
1441 struct position val; 1441 struct position val;
1442 int lastpos; 1442 int lastpos;
1443 int invis; 1443 int invis;
1444 int hscroll = XINT (w->hscroll); 1444 int hscroll = XINT (w->hscroll);
1445 int truncate = hscroll 1445 int truncate = hscroll
1446 || (truncate_partial_width_windows 1446 || (truncate_partial_width_windows
1447 && XFASTINT (w->width) < SCREEN_WIDTH (s)) 1447 && XFASTINT (w->width) < FRAME_WIDTH (f))
1448 || !NILP (current_buffer->truncate_lines); 1448 || !NILP (current_buffer->truncate_lines);
1449 int selective 1449 int selective
1450 = XTYPE (current_buffer->selective_display) == Lisp_Int 1450 = XTYPE (current_buffer->selective_display) == Lisp_Int
@@ -1453,7 +1453,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
1453#ifndef old 1453#ifndef old
1454 int selective_e = selective && !NILP (current_buffer->selective_display_ellipses); 1454 int selective_e = selective && !NILP (current_buffer->selective_display_ellipses);
1455#endif 1455#endif
1456 register struct screen_glyphs *desired_glyphs = SCREEN_DESIRED_GLYPHS (s); 1456 register struct frame_glyphs *desired_glyphs = FRAME_DESIRED_GLYPHS (f);
1457 register struct Lisp_Vector *dp = window_display_table (w); 1457 register struct Lisp_Vector *dp = window_display_table (w);
1458 int selective_rlen 1458 int selective_rlen
1459 = (selective && dp && XTYPE (DISP_INVIS_ROPE (dp)) == Lisp_String 1459 = (selective && dp && XTYPE (DISP_INVIS_ROPE (dp)) == Lisp_String
@@ -1464,7 +1464,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
1464 ? '\\' : XINT (DISP_CONTINUE_GLYPH (dp))); 1464 ? '\\' : XINT (DISP_CONTINUE_GLYPH (dp)));
1465 1465
1466 hpos += XFASTINT (w->left); 1466 hpos += XFASTINT (w->left);
1467 get_display_line (s, vpos, XFASTINT (w->left)); 1467 get_display_line (f, vpos, XFASTINT (w->left));
1468 if (tab_width <= 0 || tab_width > 20) tab_width = 8; 1468 if (tab_width <= 0 || tab_width > 20) tab_width = 8;
1469 1469
1470 if (MINI_WINDOW_P (w) && start == 1 1470 if (MINI_WINDOW_P (w) && start == 1
@@ -1652,7 +1652,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
1652 } 1652 }
1653 1653
1654 /* If point is at eol or in invisible text at eol, 1654 /* If point is at eol or in invisible text at eol,
1655 record its screen location now. */ 1655 record its frame location now. */
1656 1656
1657 if (start <= point && point <= lastpos && cursor_vpos < 0) 1657 if (start <= point && point <= lastpos && cursor_vpos < 0)
1658 { 1658 {
@@ -1665,10 +1665,10 @@ display_text_line (w, start, vpos, hpos, taboffset)
1665 if (cursor_hpos < 0) cursor_hpos = 0; 1665 if (cursor_hpos < 0) cursor_hpos = 0;
1666 if (cursor_hpos > width) cursor_hpos = width; 1666 if (cursor_hpos > width) cursor_hpos = width;
1667 cursor_hpos += XFASTINT (w->left); 1667 cursor_hpos += XFASTINT (w->left);
1668 if (w == XWINDOW (SCREEN_SELECTED_WINDOW (s))) 1668 if (w == XWINDOW (FRAME_SELECTED_WINDOW (f)))
1669 { 1669 {
1670 SCREEN_CURSOR_Y (s) = cursor_vpos; 1670 FRAME_CURSOR_Y (f) = cursor_vpos;
1671 SCREEN_CURSOR_X (s) = cursor_hpos; 1671 FRAME_CURSOR_X (f) = cursor_hpos;
1672 1672
1673 if (w == XWINDOW (selected_window)) 1673 if (w == XWINDOW (selected_window))
1674 { 1674 {
@@ -1698,7 +1698,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
1698 p1 = startp + 1; 1698 p1 = startp + 1;
1699 } 1699 }
1700 1700
1701 if (XFASTINT (w->width) + XFASTINT (w->left) != SCREEN_WIDTH (s)) 1701 if (XFASTINT (w->width) + XFASTINT (w->left) != FRAME_WIDTH (f))
1702 { 1702 {
1703 endp++; 1703 endp++;
1704 if (p1 < startp) p1 = startp; 1704 if (p1 < startp) p1 = startp;
@@ -1747,12 +1747,12 @@ display_mode_line (w)
1747 register int vpos = XFASTINT (w->height) + XFASTINT (w->top) - 1; 1747 register int vpos = XFASTINT (w->height) + XFASTINT (w->top) - 1;
1748 register int left = XFASTINT (w->left); 1748 register int left = XFASTINT (w->left);
1749 register int right = XFASTINT (w->width) + left; 1749 register int right = XFASTINT (w->width) + left;
1750 register SCREEN_PTR s = XSCREEN (WINDOW_SCREEN (w)); 1750 register FRAME_PTR f = XFRAME (WINDOW_FRAME (w));
1751 1751
1752 get_display_line (s, vpos, left); 1752 get_display_line (f, vpos, left);
1753 display_mode_element (w, vpos, left, 0, right, right, 1753 display_mode_element (w, vpos, left, 0, right, right,
1754 current_buffer->mode_line_format); 1754 current_buffer->mode_line_format);
1755 SCREEN_DESIRED_GLYPHS (s)->bufp[vpos] = 0; 1755 FRAME_DESIRED_GLYPHS (f)->bufp[vpos] = 0;
1756 1756
1757 /* Make the mode line inverse video if the entire line 1757 /* Make the mode line inverse video if the entire line
1758 is made of mode lines. 1758 is made of mode lines.
@@ -1760,19 +1760,19 @@ display_mode_line (w)
1760 or if it is the child of a full width window 1760 or if it is the child of a full width window
1761 (which implies that that window is split side-by-side 1761 (which implies that that window is split side-by-side
1762 and the rest of this line is mode lines of the sibling windows). */ 1762 and the rest of this line is mode lines of the sibling windows). */
1763 if (XFASTINT (w->width) == SCREEN_WIDTH (s) 1763 if (XFASTINT (w->width) == FRAME_WIDTH (f)
1764 || XFASTINT (XWINDOW (w->parent)->width) == SCREEN_WIDTH (s)) 1764 || XFASTINT (XWINDOW (w->parent)->width) == FRAME_WIDTH (f))
1765 SCREEN_DESIRED_GLYPHS (s)->highlight[vpos] = mode_line_inverse_video; 1765 FRAME_DESIRED_GLYPHS (f)->highlight[vpos] = mode_line_inverse_video;
1766 1766
1767#ifdef HAVE_X_WINDOWS 1767#ifdef HAVE_X_WINDOWS
1768 /* I'm trying this out because I saw Unimpress use it, but it's 1768 /* I'm trying this out because I saw Unimpress use it, but it's
1769 possible that this may mess adversely with some window managers. jla */ 1769 possible that this may mess adversely with some window managers. jla */
1770 1770
1771 if (SCREEN_IS_X (s) 1771 if (FRAME_IS_X (f)
1772 && ! SCREEN_MINIBUF_ONLY_P (s) 1772 && ! FRAME_MINIBUF_ONLY_P (f)
1773 && w == XWINDOW (s->selected_window) 1773 && w == XWINDOW (f->selected_window)
1774 && (NILP (Fstring_equal (XBUFFER (w->buffer)->name, s->name)))) 1774 && (NILP (Fstring_equal (XBUFFER (w->buffer)->name, f->name))))
1775 x_set_name (s, XBUFFER (w->buffer)->name, Qnil); 1775 x_set_name (f, XBUFFER (w->buffer)->name, Qnil);
1776#endif 1776#endif
1777} 1777}
1778 1778
@@ -1781,7 +1781,7 @@ display_mode_line (w)
1781 1781
1782 VPOS is the position of the mode line being displayed. 1782 VPOS is the position of the mode line being displayed.
1783 1783
1784 HPOS is the position (absolute on screen) where this element's text 1784 HPOS is the position (absolute on frame) where this element's text
1785 should start. The output is truncated automatically at the right 1785 should start. The output is truncated automatically at the right
1786 edge of window W. 1786 edge of window W.
1787 1787
@@ -1994,11 +1994,11 @@ decode_mode_spec (w, c, maxwidth)
1994 register int maxwidth; 1994 register int maxwidth;
1995{ 1995{
1996 Lisp_Object obj = Qnil; 1996 Lisp_Object obj = Qnil;
1997 SCREEN_PTR scr = XSCREEN (WINDOW_SCREEN (w)); 1997 FRAME_PTR f = XFRAME (WINDOW_FRAME (w));
1998 char *decode_mode_spec_buf = (char *) SCREEN_TEMP_GLYPHS (scr)->total_contents; 1998 char *decode_mode_spec_buf = (char *) FRAME_TEMP_GLYPHS (f)->total_contents;
1999 1999
2000 if (maxwidth > SCREEN_WIDTH (scr)) 2000 if (maxwidth > FRAME_WIDTH (f))
2001 maxwidth = SCREEN_WIDTH (scr); 2001 maxwidth = FRAME_WIDTH (f);
2002 2002
2003 switch (c) 2003 switch (c)
2004 { 2004 {
@@ -2143,7 +2143,7 @@ decode_mode_spec (w, c, maxwidth)
2143 MINCOL is the first column ok to end at. (Pad with spaces to this col.) 2143 MINCOL is the first column ok to end at. (Pad with spaces to this col.)
2144 MAXCOL is the last column ok to end at. Truncate here. 2144 MAXCOL is the last column ok to end at. Truncate here.
2145 -1 for MINCOL or MAXCOL means no explicit minimum or maximum. 2145 -1 for MINCOL or MAXCOL means no explicit minimum or maximum.
2146 Both count from the left edge of the screen, as does HPOS. 2146 Both count from the left edge of the frame, as does HPOS.
2147 The right edge of W is an implicit maximum. 2147 The right edge of W is an implicit maximum.
2148 If TRUNCATE is nonzero, the implicit maximum is one column before the edge. 2148 If TRUNCATE is nonzero, the implicit maximum is one column before the edge.
2149 2149
@@ -2163,7 +2163,7 @@ display_string (w, vpos, string, hpos, truncate, mincol, maxcol)
2163 int tab_width = XINT (current_buffer->tab_width); 2163 int tab_width = XINT (current_buffer->tab_width);
2164 register GLYPH *start; 2164 register GLYPH *start;
2165 register GLYPH *end; 2165 register GLYPH *end;
2166 struct screen_glyphs *desired_glyphs = SCREEN_DESIRED_GLYPHS (XSCREEN (w->screen)); 2166 struct frame_glyphs *desired_glyphs = FRAME_DESIRED_GLYPHS (XFRAME (w->frame));
2167 GLYPH *p1start = desired_glyphs->glyphs[vpos] + hpos; 2167 GLYPH *p1start = desired_glyphs->glyphs[vpos] + hpos;
2168 int window_width = XFASTINT (w->width); 2168 int window_width = XFASTINT (w->width);
2169 2169
@@ -2182,7 +2182,7 @@ display_string (w, vpos, string, hpos, truncate, mincol, maxcol)
2182 end = start + window_width - (truncate != 0); 2182 end = start + window_width - (truncate != 0);
2183 2183
2184 if ((window_width + XFASTINT (w->left)) 2184 if ((window_width + XFASTINT (w->left))
2185 != SCREEN_WIDTH (XSCREEN (WINDOW_SCREEN (w)))) 2185 != FRAME_WIDTH (XFRAME (WINDOW_FRAME (w))))
2186 *end-- = '|'; 2186 *end-- = '|';
2187 2187
2188 if (maxcol >= 0 && end - desired_glyphs->glyphs[vpos] > maxcol) 2188 if (maxcol >= 0 && end - desired_glyphs->glyphs[vpos] > maxcol)
@@ -2288,14 +2288,14 @@ See also `overlay-arrow-string'.");
2288 2288
2289 DEFVAR_INT ("scroll-step", &scroll_step, 2289 DEFVAR_INT ("scroll-step", &scroll_step,
2290 "*The number of lines to try scrolling a window by when point moves out.\n\ 2290 "*The number of lines to try scrolling a window by when point moves out.\n\
2291If that fails to bring point back on screen, point is centered instead.\n\ 2291If that fails to bring point back on frame, point is centered instead.\n\
2292If this is zero, point is always centered after it moves off screen."); 2292If this is zero, point is always centered after it moves off frame.");
2293 2293
2294 DEFVAR_INT ("debug-end-pos", &debug_end_pos, "Don't ask"); 2294 DEFVAR_INT ("debug-end-pos", &debug_end_pos, "Don't ask");
2295 2295
2296 DEFVAR_BOOL ("truncate-partial-width-windows", 2296 DEFVAR_BOOL ("truncate-partial-width-windows",
2297 &truncate_partial_width_windows, 2297 &truncate_partial_width_windows,
2298 "*Non-nil means truncate lines in all windows less than full screen wide."); 2298 "*Non-nil means truncate lines in all windows less than full frame wide.");
2299 truncate_partial_width_windows = 1; 2299 truncate_partial_width_windows = 1;
2300 2300
2301 DEFVAR_BOOL ("mode-line-inverse-video", &mode_line_inverse_video, 2301 DEFVAR_BOOL ("mode-line-inverse-video", &mode_line_inverse_video,
@@ -2322,13 +2322,13 @@ init_xdisp ()
2322 2322
2323 if (!noninteractive) 2323 if (!noninteractive)
2324 { 2324 {
2325 SCREEN_PTR s = XSCREEN (WINDOW_SCREEN (XWINDOW (root_window))); 2325 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (root_window)));
2326 XFASTINT (XWINDOW (root_window)->top) = 0; 2326 XFASTINT (XWINDOW (root_window)->top) = 0;
2327 set_window_height (root_window, SCREEN_HEIGHT (s) - 1, 0); 2327 set_window_height (root_window, FRAME_HEIGHT (f) - 1, 0);
2328 XFASTINT (mini_w->top) = SCREEN_HEIGHT (s) - 1; 2328 XFASTINT (mini_w->top) = FRAME_HEIGHT (f) - 1;
2329 set_window_height (minibuf_window, 1, 0); 2329 set_window_height (minibuf_window, 1, 0);
2330 2330
2331 XFASTINT (XWINDOW (root_window)->width) = SCREEN_WIDTH (s); 2331 XFASTINT (XWINDOW (root_window)->width) = FRAME_WIDTH (f);
2332 XFASTINT (mini_w->width) = SCREEN_WIDTH (s); 2332 XFASTINT (mini_w->width) = FRAME_WIDTH (f);
2333 } 2333 }
2334} 2334}