diff options
author | Eli Zaretskii <eliz@gnu.org> | 2022-06-24 10:44:44 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2022-06-24 10:44:44 +0300 |
commit | 289b457cac1439ac5f9bb6ce1143d91b8d52da91 (patch) | |
tree | fd527d18b0bb54a9af6ff4dfd15574c23efab11c /src/keyboard.c | |
parent | fbb703f60aa9bbe3a0c60ee6e52d60d58126999f (diff) | |
parent | 6fcd8ca743c35566e9216fd0681914fde05761b3 (diff) | |
download | emacs-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/keyboard.c')
-rw-r--r-- | src/keyboard.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 6bc2afd40ac..7fb7afca87a 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1501,7 +1501,14 @@ command_loop_1 (void) point_before_last_command_or_undo = PT; buffer_before_last_command_or_undo = current_buffer; + /* Restart our counting of redisplay ticks before + executing the command, so that we don't blame the new + command for the sins of the previous one. */ + update_redisplay_ticks (0, NULL); + display_working_on_window_p = false; + call1 (Qcommand_execute, Vthis_command); + display_working_on_window_p = false; #ifdef HAVE_WINDOW_SYSTEM /* Do not check display_hourglass_p here, because |