summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2022-06-24 10:44:44 +0300
committerEli Zaretskii <eliz@gnu.org>2022-06-24 10:44:44 +0300
commit289b457cac1439ac5f9bb6ce1143d91b8d52da91 (patch)
treefd527d18b0bb54a9af6ff4dfd15574c23efab11c /src/indent.c
parentfbb703f60aa9bbe3a0c60ee6e52d60d58126999f (diff)
parent6fcd8ca743c35566e9216fd0681914fde05761b3 (diff)
downloademacs-289b457cac1439ac5f9bb6ce1143d91b8d52da91.tar.gz
Merge branch 'abort-redisplay'
This allows abandoning the redisplay of a window that takes too long to complete. Bug#45898 * src/xdisp.c (update_redisplay_ticks): New function. (init_iterator, set_iterator_to_next): Call 'update_redisplay_ticks'. (syms_of_xdisp) <max_redisplay_ticks>: New variable. <list_of_error>: Remove 'void-variable': it is no longer needed, since 'calc_pixel_width_or_height' can no longer signal a void-variable error, and it gets in the way of aborting redisplay via 'redisplay_window_error'. * src/keyboard.c (command_loop_1): Reinitialize the tick count before executing each command in the loop. * src/syntax.c (scan_sexps_forward): Call 'update_redisplay_ticks' after finishing the loop. * src/dispnew.c (make_current): Make sure enabled rows of the current matrix have a valid hash, even if redisplay of a window was aborted due to slowness. This avoids assertion violations in 'scrolling_window' due to the wrong hash value. * src/xdisp.c (display_working_on_window_p): New global variable. (unwind_display_working_on_window): New function. * src/keyboard.c (command_loop_1): Reset 'display_working_on_window_p' before and after executing commands. * src/window.c (Frecenter, window_scroll, displayed_window_lines): * src/indent.c (Fvertical_motion): Set 'display_working_on_window_p' before calling 'start_display'. * src/syntax.c (scan_sexps_forward): Call 'update_redisplay_ticks' after finishing the loop. * src/regex-emacs.c (re_match_2_internal): * src/bidi.c (bidi_find_bracket_pairs, bidi_fetch_char) (bidi_paragraph_init, bidi_find_other_level_edge): Update the redisplay tick count as appropriate, when moving the iterator by one character position actually requires to examine many more positions. * src/xdisp.c (redisplay_window_error): Show messages about aborted redisplay of a window as delayed-warnings. * doc/emacs/trouble.texi (DEL Does Not Delete): Move to the end of the chapter. This issue is no longer frequent or important as it was back in Emacs 20 days. (Long Lines): Document 'max-redisplay-ticks'. * doc/emacs/emacs.texi (Top): Update the detailed menu. * etc/NEWS: Announce 'max-redisplay-ticks'.
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/indent.c b/src/indent.c
index c071b43ab4c..c3d78518c43 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2177,6 +2177,8 @@ whether or not it is currently displayed in some window. */)
line_number_display_width (w, &lnum_width, &lnum_pixel_width);
SET_TEXT_POS (pt, PT, PT_BYTE);
itdata = bidi_shelve_cache ();
+ record_unwind_protect_void (unwind_display_working_on_window);
+ display_working_on_window_p = true;
start_display (&it, w, pt);
it.lnum_width = lnum_width;
first_x = it.first_visible_x;