Mercurial > emacs
comparison src/xdisp.c @ 769:1f320a0729f8
*** empty log message ***
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Tue, 14 Jul 1992 15:21:18 +0000 |
parents | a8d94735277e |
children | 0a413c9fe0fd |
comparison
equal
deleted
inserted
replaced
768:4abf65b235d9 | 769:1f320a0729f8 |
---|---|
21 #include "config.h" | 21 #include "config.h" |
22 #include <stdio.h> | 22 #include <stdio.h> |
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" |
30 #include "buffer.h" | 30 #include "buffer.h" |
31 #include "indent.h" | 31 #include "indent.h" |
42 | 42 |
43 #define min(a, b) ((a) < (b) ? (a) : (b)) | 43 #define min(a, b) ((a) < (b) ? (a) : (b)) |
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. */ |
49 static int this_line_bufpos; | 49 static 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 */ |
53 static int this_line_endpos; | 53 static int this_line_endpos; |
54 | 54 |
55 /* The vertical position of this screen line. */ | 55 /* The vertical position of this frame line. */ |
56 static int this_line_vpos; | 56 static 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 */ |
61 static int this_line_start_hpos; | 61 static int this_line_start_hpos; |
62 | 62 |
63 /* Buffer that this_line variables are describing. */ | 63 /* Buffer that this_line variables are describing. */ |
64 static struct buffer *this_line_buffer; | 64 static 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. */ |
69 static int scroll_bottom_vpos; | 69 static 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. */ |
75 char *previous_echo_glyphs; | 75 char *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 */ |
78 int truncate_partial_width_windows; | 78 int truncate_partial_width_windows; |
79 | 79 |
80 Lisp_Object Vglobal_mode_string; | 80 Lisp_Object Vglobal_mode_string; |
81 | 81 |
82 /* Marker for where to display an arrow on top of the buffer text. */ | 82 /* Marker for where to display an arrow on top of the buffer text. */ |
89 Lisp_Object last_arrow_position, last_arrow_string; | 89 Lisp_Object last_arrow_position, last_arrow_string; |
90 | 90 |
91 /* Nonzero if overlay arrow has been displayed once in this window. */ | 91 /* Nonzero if overlay arrow has been displayed once in this window. */ |
92 static int overlay_arrow_seen; | 92 static 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. */ |
96 int scroll_step; | 96 int scroll_step; |
97 | 97 |
98 /* Nonzero if try_window_id has made blank lines at window bottom | 98 /* Nonzero if try_window_id has made blank lines at window bottom |
99 since the last redisplay that paused */ | 99 since the last redisplay that paused */ |
101 | 101 |
102 /* Number of windows showing the buffer of the selected window. | 102 /* Number of windows showing the buffer of the selected window. |
103 keyboard.c refers to this. */ | 103 keyboard.c refers to this. */ |
104 int buffer_shared; | 104 int 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 |
110 static int cursor_vpos; | 110 static int cursor_vpos; |
111 static int cursor_hpos; | 111 static int cursor_hpos; |
165 /* Nonzero if window sizes or contents have changed | 165 /* Nonzero if window sizes or contents have changed |
166 since last redisplay that finished */ | 166 since last redisplay that finished */ |
167 int windows_or_buffers_changed; | 167 int 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. */ |
172 int message_buf_print; | 172 int message_buf_print; |
173 | 173 |
174 /* dump an informative message to the minibuf */ | 174 /* dump an informative message to the minibuf */ |
175 /* VARARGS 1 */ | 175 /* VARARGS 1 */ |
185 noninteractive_need_newline = 0; | 185 noninteractive_need_newline = 0; |
186 fprintf (stderr, m, a1, a2, a3); | 186 fprintf (stderr, 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 { |
201 #ifdef NO_ARG_ARRAY | 201 #ifdef NO_ARG_ARRAY |
202 int a[3]; | 202 int a[3]; |
203 a[0] = a1; | 203 a[0] = a1; |
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. */ |
219 message_buf_print = 0; | 219 message_buf_print = 0; |
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 } |
227 | 227 |
228 /* Specify m, a string, as a message in the minibuf. */ | 228 /* Specify m, a string, as a message in the minibuf. */ |
236 putc ('\n', stderr); | 236 putc ('\n', stderr); |
237 noninteractive_need_newline = 0; | 237 noninteractive_need_newline = 0; |
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 } |
258 | 258 |
259 static void | 259 static void |
260 echo_area_display () | 260 echo_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 { |
293 int i; | 293 int i; |
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 } |
303 else if (!EQ (minibuf_window, selected_window)) | 303 else if (!EQ (minibuf_window, selected_window)) |
304 windows_or_buffers_changed++; | 304 windows_or_buffers_changed++; |
307 this_line_bufpos = 0; | 307 this_line_bufpos = 0; |
308 | 308 |
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 |
316 message is no longer requested, we clear the echo area | 316 message is no longer requested, we clear the echo area |
317 or bring back the minibuffer if that is in use. | 317 or bring back the minibuffer if that is in use. |
336 extern int input_pending; | 336 extern int input_pending; |
337 | 337 |
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) |
355 { | 355 { |
356 echo_area_display (); | 356 echo_area_display (); |
367 w->update_mode_line = Qt; | 367 w->update_mode_line = Qt; |
368 if (buffer_shared > 1) | 368 if (buffer_shared > 1) |
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 |
376 /* If specs for an arrow have changed, do thorough redisplay | 376 /* If specs for an arrow have changed, do thorough redisplay |
377 to ensure we remove any arrow that should no longer exist. */ | 377 to ensure we remove any arrow that should no longer exist. */ |
380 all_windows = 1, clip_changed = 1; | 380 all_windows = 1, clip_changed = 1; |
381 | 381 |
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) |
389 && NILP (w->force_start) | 389 && NILP (w->force_start) |
390 /* Point must be on the line that we have info recorded about */ | 390 /* Point must be on the line that we have info recorded about */ |
420 /* If line contains point, is not continued, | 420 /* If line contains point, is not continued, |
421 and ends at same distance from eob as before, we win */ | 421 and ends at same distance from eob as before, we win */ |
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 } |
429 else | 429 else |
430 goto cancel; | 430 goto cancel; |
443 pos = *compute_motion (tlbufpos, 0, | 443 pos = *compute_motion (tlbufpos, 0, |
444 XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0, | 444 XINT (w->hscroll) ? 1 - XINT (w->hscroll) : 0, |
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 |
459 goto cancel; | 459 goto cancel; |
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; |
467 all_windows |= buffer_shared > 1; | 467 all_windows |= buffer_shared > 1; |
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 |
501 update: | 501 update: |
502 /* Prevent various kinds of signals during display update. | 502 /* Prevent various kinds of signals during display update. |
504 which can cause an apparent I/O error. */ | 504 which can cause an apparent I/O error. */ |
505 if (interrupt_input) | 505 if (interrupt_input) |
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 { |
557 this_line_bufpos = 0; | 557 this_line_bufpos = 0; |
558 if (!NILP (last_arrow_position)) | 558 if (!NILP (last_arrow_position)) |
559 { | 559 { |
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) |
575 { | 575 { |
576 register struct buffer *b = XBUFFER (w->buffer); | 576 register struct buffer *b = XBUFFER (w->buffer); |
580 unchanged_modified = BUF_MODIFF (b); | 580 unchanged_modified = BUF_MODIFF (b); |
581 beg_unchanged = BUF_GPT (b) - BUF_BEG (b); | 581 beg_unchanged = BUF_GPT (b) - BUF_BEG (b); |
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); |
590 else | 590 else |
591 { | 591 { |
608 | 608 |
609 if (interrupt_input) | 609 if (interrupt_input) |
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 |
617 /* Redisplay, but leave alone any recent echo area message | 617 /* Redisplay, but leave alone any recent echo area message |
618 unless another message has been requested in its place. | 618 unless another message has been requested in its place. |
686 redisplay_window (window, just_this_one) | 686 redisplay_window (window, just_this_one) |
687 Lisp_Object window; | 687 Lisp_Object window; |
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; |
701 int opoint; | 701 int opoint; |
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 |
709 if (!NILP (w->vchild)) | 709 if (!NILP (w->vchild)) |
710 { | 710 { |
731 } | 731 } |
732 else | 732 else |
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 |
745 return; | 745 return; |
746 } | 746 } |
804 (hscroll ? 1 - hscroll : 0), | 804 (hscroll ? 1 - hscroll : 0), |
805 ZV, height / 2, | 805 ZV, height / 2, |
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; |
826 since in that case the minibuffer contents per se are usually unchanged. | 826 since in that case the minibuffer contents per se are usually unchanged. |
827 This code is of no real use in the minibuffer since | 827 This code is of no real use in the minibuffer since |
828 the handling of this_line_bufpos, etc., | 828 the handling of this_line_bufpos, etc., |
829 in redisplay handles the same cases. */ | 829 in redisplay handles the same cases. */ |
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), |
837 point, height + 1, 10000, width, hscroll, | 837 point, height + 1, 10000, width, hscroll, |
838 pos_tab_offset (w, startp)); | 838 pos_tab_offset (w, startp)); |
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; |
857 } | 857 } |
858 /* Don't bother trying redisplay with same start; | 858 /* Don't bother trying redisplay with same start; |
870 && point >= startp | 870 && point >= startp |
871 && XFASTINT (w->last_modified) | 871 && XFASTINT (w->last_modified) |
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. |
882 tem == -2 means try again with same start, | 882 tem == -2 means try again with same start, |
883 and nothing but whitespace follows the changed stuff. | 883 and nothing but whitespace follows the changed stuff. |
889 /* Avoid starting display at end of buffer! */ | 889 /* Avoid starting display at end of buffer! */ |
890 && (startp < ZV || startp == BEGV | 890 && (startp < ZV || startp == BEGV |
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; |
898 else | 898 else |
899 cancel_my_columns (w); | 899 cancel_my_columns (w); |
940 | 940 |
941 done: | 941 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 |
949 SET_PT (opoint); | 949 SET_PT (opoint); |
950 current_buffer = old; | 950 current_buffer = old; |
961 register struct window *w = XWINDOW (window); | 961 register struct window *w = XWINDOW (window); |
962 register int height = window_internal_height (w); | 962 register int height = window_internal_height (w); |
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); |
972 cursor_vpos = -1; | 972 cursor_vpos = -1; |
973 overlay_arrow_seen = 0; | 973 overlay_arrow_seen = 0; |
985 = vpos - (val.vpos && FETCH_CHAR (val.bufpos - 1) != '\n'); | 985 = vpos - (val.vpos && FETCH_CHAR (val.bufpos - 1) != '\n'); |
986 pos = val.bufpos; | 986 pos = val.bufpos; |
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. */ |
1003 w->window_end_valid = Qnil; | 1003 w->window_end_valid = Qnil; |
1004 } | 1004 } |
1015 Lisp_Object window; | 1015 Lisp_Object window; |
1016 { | 1016 { |
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; |
1028 register int i, tem; | 1028 register int i, tem; |
1029 int last_text_vpos = 0; | 1029 int last_text_vpos = 0; |
1048 pos_tab_offset (w, start)); | 1048 pos_tab_offset (w, start)); |
1049 if (bp.vpos >= height) | 1049 if (bp.vpos >= height) |
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, |
1058 Z, height, 0, | 1058 Z, height, 0, |
1059 width, hscroll, pos_tab_offset (w, start)); | 1059 width, hscroll, pos_tab_offset (w, start)); |
1064 return 0; | 1064 return 0; |
1065 } | 1065 } |
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; |
1073 val.hpos = lmargin; | 1073 val.hpos = lmargin; |
1074 if (pos < start) | 1074 if (pos < start) |
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 || |
1082 /* Likewise if we have to worry about selective display. */ | 1082 /* Likewise if we have to worry about selective display. */ |
1083 (XTYPE (current_buffer->selective_display) == Lisp_Int | 1083 (XTYPE (current_buffer->selective_display) == Lisp_Int |
1109 /* Compute the cursor position after that newline. */ | 1109 /* Compute the cursor position after that newline. */ |
1110 ep = *compute_motion (pos, vpos, val.hpos, tem, | 1110 ep = *compute_motion (pos, vpos, val.hpos, tem, |
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 |
1119 stop_vpos = ep.vpos; | 1119 stop_vpos = ep.vpos; |
1120 | 1120 |
1141 xp = *compute_motion (ep.bufpos, ep.vpos, ep.hpos, | 1141 xp = *compute_motion (ep.bufpos, ep.vpos, ep.hpos, |
1142 Z - XFASTINT (w->window_end_pos), | 1142 Z - XFASTINT (w->window_end_pos), |
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 { |
1150 tem = FETCH_CHAR (i); | 1150 tem = FETCH_CHAR (i); |
1151 if (tem != ' ' && tem != '\n' && tem != '\t') | 1151 if (tem != ' ' && tem != '\n' && tem != '\t') |
1154 if (i == xp.bufpos) | 1154 if (i == xp.bufpos) |
1155 return -2; | 1155 return -2; |
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) |
1163 { | 1163 { |
1164 pp = *compute_motion (ep.bufpos, ep.vpos, ep.hpos, | 1164 pp = *compute_motion (ep.bufpos, ep.vpos, ep.hpos, |
1184 stop_vpos -= scroll_amount; | 1184 stop_vpos -= scroll_amount; |
1185 scroll_amount = 0; | 1185 scroll_amount = 0; |
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) |
1195 {} | 1195 {} |
1196 else if (bp.bufpos == Z - end_unchanged) | 1196 else if (bp.bufpos == Z - end_unchanged) |
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) |
1204 /* Return "try normal display with same window-start." | 1204 /* Return "try normal display with same window-start." |
1205 Too bad we can't prevent further scroll-thinking. */ | 1205 Too bad we can't prevent further scroll-thinking. */ |
1206 return -2; | 1206 return -2; |
1207 /* If pure deletion, scroll up as many lines as possible. | 1207 /* If pure deletion, scroll up as many lines as possible. |
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; |
1215 } | 1215 } |
1216 else if (scroll_amount) | 1216 else if (scroll_amount) |
1218 /* If reprinting everything is nearly as fast as scrolling, | 1218 /* If reprinting everything is nearly as fast as scrolling, |
1219 don't bother scrolling. Can happen if lines are short. */ | 1219 don't bother scrolling. Can happen if lines are short. */ |
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; |
1234 } | 1234 } |
1235 } | 1235 } |
1270 2) we have scrolled lines below stop_vpos by scroll_amount */ | 1270 2) we have scrolled lines below stop_vpos by scroll_amount */ |
1271 | 1271 |
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; |
1279 XFASTINT (w->window_end_pos) = Z - val.bufpos; | 1279 XFASTINT (w->window_end_pos) = Z - val.bufpos; |
1280 } | 1280 } |
1283 redisplay to fill those lines */ | 1283 redisplay to fill those lines */ |
1284 if (scroll_amount < 0) | 1284 if (scroll_amount < 0) |
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; |
1292 if (pos == ZV) | 1292 if (pos == ZV) |
1293 vpos = height + scroll_amount; | 1293 vpos = height + scroll_amount; |
1317 if (xp.bufpos == ZV | 1317 if (xp.bufpos == ZV |
1318 && xp.bufpos == point) | 1318 && xp.bufpos == point) |
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; |
1326 | 1326 |
1327 /* Attempt to adjust end-of-text positions to new bottom line */ | 1327 /* Attempt to adjust end-of-text positions to new bottom line */ |
1344 /* If point was not in a line that was displayed, find it */ | 1344 /* If point was not in a line that was displayed, find it */ |
1345 if (cursor_vpos < 0) | 1345 if (cursor_vpos < 0) |
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 { |
1365 val = *compute_motion (start, 0, lmargin, ZV, | 1365 val = *compute_motion (start, 0, lmargin, ZV, |
1366 height, - (1 << (SHORTBITS - 1)), | 1366 height, - (1 << (SHORTBITS - 1)), |
1406 This is done for negative hscroll, or when this is a continuation line | 1406 This is done for negative hscroll, or when this is a continuation line |
1407 and the continuation occurred in the middle of a multi-column character. | 1407 and the continuation occurred in the middle of a multi-column character. |
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. |
1415 The vpos field is not really a vpos; it is 1 unless the line is continued */ | 1415 The vpos field is not really a vpos; it is 1 unless the line is continued */ |
1416 | 1416 |
1431 register int pause; | 1431 register int pause; |
1432 register unsigned char *p; | 1432 register unsigned char *p; |
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 |
1451 ? XINT (current_buffer->selective_display) | 1451 ? XINT (current_buffer->selective_display) |
1452 : !NILP (current_buffer->selective_display) ? -1 : 0; | 1452 : !NILP (current_buffer->selective_display) ? -1 : 0; |
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 |
1460 ? XSTRING (DISP_INVIS_ROPE (dp))->size / sizeof (GLYPH) : 0); | 1460 ? XSTRING (DISP_INVIS_ROPE (dp))->size / sizeof (GLYPH) : 0); |
1461 GLYPH truncator = (dp == 0 || XTYPE (DISP_TRUNC_GLYPH (dp)) != Lisp_Int | 1461 GLYPH truncator = (dp == 0 || XTYPE (DISP_TRUNC_GLYPH (dp)) != Lisp_Int |
1462 ? '$' : XINT (DISP_TRUNC_GLYPH (dp))); | 1462 ? '$' : XINT (DISP_TRUNC_GLYPH (dp))); |
1463 GLYPH continuer = (dp == 0 || XTYPE (DISP_CONTINUE_GLYPH (dp)) != Lisp_Int | 1463 GLYPH continuer = (dp == 0 || XTYPE (DISP_CONTINUE_GLYPH (dp)) != Lisp_Int |
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 |
1471 && vpos == XFASTINT (w->top)) | 1471 && vpos == XFASTINT (w->top)) |
1472 { | 1472 { |
1650 } | 1650 } |
1651 } | 1651 } |
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 { |
1659 cursor_vpos = vpos; | 1659 cursor_vpos = vpos; |
1660 cursor_hpos = p1 - startp; | 1660 cursor_hpos = p1 - startp; |
1663 if (cursor_vpos == vpos) | 1663 if (cursor_vpos == vpos) |
1664 { | 1664 { |
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 { |
1675 /* Line is not continued and did not start | 1675 /* Line is not continued and did not start |
1676 in middle of character */ | 1676 in middle of character */ |
1696 *startp = truncator; | 1696 *startp = truncator; |
1697 if (p1 <= startp) | 1697 if (p1 <= startp) |
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; |
1705 while (p1 < endp) *p1++ = SPACEGLYPH; | 1705 while (p1 < endp) *p1++ = SPACEGLYPH; |
1706 *p1++ = '|'; | 1706 *p1++ = '|'; |
1745 struct window *w; | 1745 struct window *w; |
1746 { | 1746 { |
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. |
1759 I.e. if this window is full width, | 1759 I.e. if this window is full width, |
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 |
1779 /* Contribute ELT to the mode line for window W. | 1779 /* Contribute ELT to the mode line for window W. |
1780 How it translates into text depends on its data type. | 1780 How it translates into text depends on its data type. |
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 |
1788 DEPTH is the depth in recursion. It is used to prevent | 1788 DEPTH is the depth in recursion. It is used to prevent |
1789 infinite recursion here. | 1789 infinite recursion here. |
1992 struct window *w; | 1992 struct window *w; |
1993 register char c; | 1993 register char c; |
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 { |
2005 case 'b': | 2005 case 'b': |
2006 obj = current_buffer->name; | 2006 obj = current_buffer->name; |
2141 TRUNCATE is GLYPH to display at end if truncated. Zero for none. | 2141 TRUNCATE is GLYPH to display at end if truncated. Zero for none. |
2142 | 2142 |
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 |
2150 Returns ending hpos */ | 2150 Returns ending hpos */ |
2151 | 2151 |
2161 register GLYPH *p1; | 2161 register GLYPH *p1; |
2162 int hscroll = XINT (w->hscroll); | 2162 int hscroll = XINT (w->hscroll); |
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 |
2170 /* Use the standard display table, not the window's display table. | 2170 /* Use the standard display table, not the window's display table. |
2171 We don't want the mode line in rot13. */ | 2171 We don't want the mode line in rot13. */ |
2180 p1 = p1start; | 2180 p1 = p1start; |
2181 start = desired_glyphs->glyphs[vpos] + XFASTINT (w->left); | 2181 start = desired_glyphs->glyphs[vpos] + XFASTINT (w->left); |
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) |
2189 end = desired_glyphs->glyphs[vpos] + maxcol; | 2189 end = desired_glyphs->glyphs[vpos] + maxcol; |
2190 if (maxcol >= 0 && mincol > maxcol) | 2190 if (maxcol >= 0 && mincol > maxcol) |
2286 "String to display as an arrow. See also `overlay-arrow-position'."); | 2286 "String to display as an arrow. See also `overlay-arrow-position'."); |
2287 Voverlay_arrow_string = Qnil; | 2287 Voverlay_arrow_string = Qnil; |
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\ |
2291 If that fails to bring point back on screen, point is centered instead.\n\ | 2291 If that fails to bring point back on frame, point is centered instead.\n\ |
2292 If this is zero, point is always centered after it moves off screen."); | 2292 If 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, |
2302 "*Non-nil means use inverse video for the mode line."); | 2302 "*Non-nil means use inverse video for the mode line."); |
2303 mode_line_inverse_video = 1; | 2303 mode_line_inverse_video = 1; |
2320 echo_area_glyphs = 0; | 2320 echo_area_glyphs = 0; |
2321 previous_echo_glyphs = 0; | 2321 previous_echo_glyphs = 0; |
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 } |