comparison src/xdisp.c @ 25316:561aa7ea85a7

(unwind_redisplay): New. Resets flag redisplaying_p. (redisplay_internal): Register unwind_redisplay with register_unwind_protect. (try_window_reusing_current_matrix): If new start > old start, give up if start pos of first reusable row is not equal to new start.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 17 Aug 1999 22:44:56 +0000
parents 273b3c17ce68
children 9747bbf3e480
comparison
equal deleted inserted replaced
25315:79bb4978ab2e 25316:561aa7ea85a7
598 598
599 599
600 600
601 /* Function prototypes. */ 601 /* Function prototypes. */
602 602
603 static Lisp_Object unwind_redisplay P_ ((Lisp_Object));
603 static int string_char_and_length P_ ((unsigned char *, int, int *)); 604 static int string_char_and_length P_ ((unsigned char *, int, int *));
604 static struct text_pos display_prop_end P_ ((struct it *, Lisp_Object, 605 static struct text_pos display_prop_end P_ ((struct it *, Lisp_Object,
605 struct text_pos)); 606 struct text_pos));
606 static int compute_window_start_on_continuation_line P_ ((struct window *)); 607 static int compute_window_start_on_continuation_line P_ ((struct window *));
607 static Lisp_Object eval_handler P_ ((Lisp_Object)); 608 static Lisp_Object eval_handler P_ ((Lisp_Object));
6353 struct frame *f = XFRAME (w->frame); 6354 struct frame *f = XFRAME (w->frame);
6354 int pause; 6355 int pause;
6355 int must_finish = 0; 6356 int must_finish = 0;
6356 struct text_pos tlbufpos, tlendpos; 6357 struct text_pos tlbufpos, tlendpos;
6357 int number_of_visible_frames; 6358 int number_of_visible_frames;
6359 int count;
6358 6360
6359 /* Non-zero means redisplay has to consider all windows on all 6361 /* Non-zero means redisplay has to consider all windows on all
6360 frames. Zero means, only selected_window is considered. */ 6362 frames. Zero means, only selected_window is considered. */
6361 int consider_all_windows_p; 6363 int consider_all_windows_p;
6362 6364
6383 #ifdef USE_X_TOOLKIT 6385 #ifdef USE_X_TOOLKIT
6384 if (popup_activated ()) 6386 if (popup_activated ())
6385 return; 6387 return;
6386 #endif 6388 #endif
6387 6389
6390 /* I don't think this happens but let's be paranoid. */
6388 if (redisplaying_p) 6391 if (redisplaying_p)
6389 return; 6392 return;
6393
6394 /* Record a function that resets redisplaying_p to its old value
6395 when we leave this function. */
6396 count = specpdl_ptr - specpdl;
6397 record_unwind_protect (unwind_redisplay, make_number (redisplaying_p));
6390 ++redisplaying_p; 6398 ++redisplaying_p;
6391 6399
6392 retry: 6400 retry:
6393 6401
6394 /* If new fonts have been loaded that make a glyph matrix adjustment 6402 /* If new fonts have been loaded that make a glyph matrix adjustment
6395 necessary, do it. */ 6403 necessary, do it. */
6396 if (fonts_changed_p) 6404 if (fonts_changed_p)
6974 if (windows_or_buffers_changed && !pause) 6982 if (windows_or_buffers_changed && !pause)
6975 goto retry; 6983 goto retry;
6976 6984
6977 end_of_redisplay:; 6985 end_of_redisplay:;
6978 6986
6979 if (--redisplaying_p < 0) 6987 unbind_to (count, Qnil);
6980 redisplaying_p = 0;
6981 } 6988 }
6982 6989
6983 6990
6984 /* Redisplay, but leave alone any recent echo area message unless 6991 /* Redisplay, but leave alone any recent echo area message unless
6985 another message has been requested in its place. 6992 another message has been requested in its place.
7004 echo_area_glyphs = NULL; 7011 echo_area_glyphs = NULL;
7005 echo_area_message = Qnil; 7012 echo_area_message = Qnil;
7006 } 7013 }
7007 else 7014 else
7008 redisplay_internal (1); 7015 redisplay_internal (1);
7016 }
7017
7018
7019 /* Function registered with record_unwind_protect in
7020 redisplay_internal. Clears the flag indicating that a redisplay is
7021 in progress. */
7022
7023 static Lisp_Object
7024 unwind_redisplay (old_redisplaying_p)
7025 Lisp_Object old_redisplaying_p;
7026 {
7027 redisplaying_p = XFASTINT (old_redisplaying_p);
7009 } 7028 }
7010 7029
7011 7030
7012 /* Mark the display of windows in the window tree rooted at WINDOW as 7031 /* Mark the display of windows in the window tree rooted at WINDOW as
7013 accurate or inaccurate. If FLAG is non-zero mark display of WINDOW 7032 accurate or inaccurate. If FLAG is non-zero mark display of WINDOW
8699 < CHARPOS (new_start))) 8718 < CHARPOS (new_start)))
8700 ++first_reusable_row; 8719 ++first_reusable_row;
8701 8720
8702 /* Give up if there is no row to reuse. */ 8721 /* Give up if there is no row to reuse. */
8703 if (MATRIX_ROW_BOTTOM_Y (first_reusable_row) >= yb 8722 if (MATRIX_ROW_BOTTOM_Y (first_reusable_row) >= yb
8704 || !first_reusable_row->enabled_p) 8723 || !first_reusable_row->enabled_p
8724 || (MATRIX_ROW_START_CHARPOS (first_reusable_row)
8725 != CHARPOS (new_start)))
8705 return 0; 8726 return 0;
8706 8727
8707 /* The row we found must start at new_start, or else something
8708 is broken. */
8709 xassert (MATRIX_ROW_START_CHARPOS (first_reusable_row)
8710 == CHARPOS (new_start));
8711
8712 /* We can reuse fully visible rows beginning with 8728 /* We can reuse fully visible rows beginning with
8713 first_reusable_row to the end of the window. Set 8729 first_reusable_row to the end of the window. Set
8714 first_row_to_display to the first row that cannot be reused. 8730 first_row_to_display to the first row that cannot be reused.
8715 Set pt_row to the row containing point, if there is any. */ 8731 Set pt_row to the row containing point, if there is any. */
8716 first_row_to_display = first_reusable_row; 8732 first_row_to_display = first_reusable_row;