diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 764f7f33bff..5cdb732e5f3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -600,6 +600,7 @@ enum move_it_result | |||
| 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)); |
| @@ -6355,6 +6356,7 @@ redisplay_internal (preserve_echo_area) | |||
| 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. */ |
| @@ -6385,10 +6387,16 @@ redisplay_internal (preserve_echo_area) | |||
| 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; |
| 6390 | ++redisplaying_p; | ||
| 6391 | 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)); | ||
| 6398 | ++redisplaying_p; | ||
| 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 |
| @@ -6976,8 +6984,7 @@ update: | |||
| 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 | ||
| @@ -7009,6 +7016,18 @@ redisplay_preserve_echo_area () | |||
| 7009 | } | 7016 | } |
| 7010 | 7017 | ||
| 7011 | 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); | ||
| 7028 | } | ||
| 7029 | |||
| 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 |
| 7014 | as accurate. If FLAG is zero arrange for WINDOW to be redisplayed | 7033 | as accurate. If FLAG is zero arrange for WINDOW to be redisplayed |
| @@ -8701,14 +8720,11 @@ try_window_reusing_current_matrix (w) | |||
| 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. |