diff options
author | Eli Zaretskii <eliz@gnu.org> | 2021-08-17 21:29:58 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2021-08-17 21:29:58 +0300 |
commit | 130d47bdccee31d9fd9d74e273443416d2da20fa (patch) | |
tree | 6dcf7481313290b70d9b568bdbdd556985e09e7e | |
parent | c609b4c7287c416e320a1b95f866f1ce1ce7254d (diff) | |
download | emacs-130d47bdccee31d9fd9d74e273443416d2da20fa.tar.gz |
Another fix for quitting while displaying non-selected windows
* src/xdisp.c (handle_face_prop, extend_face_to_end_of_line):
Inhibit quitting around the call to face_at_pos, to prevent
leaking wrong value of point when the user quits while we
redisplay a non-selected window. (Bug#44448)
-rw-r--r-- | src/xdisp.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 972b90177c6..3b7ed2be203 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4472,7 +4472,13 @@ face_at_pos (const struct it *it, enum lface_attribute_index attr_filter) static enum prop_handled handle_face_prop (struct it *it) { + ptrdiff_t count = SPECPDL_INDEX (); + /* Don't allow the user to quit out of face-merging code, in case + this is called when redisplaying a non-selected window, with + point temporarily moved to window-point. */ + specbind (Qinhibit_quit, Qt); const int new_face_id = face_at_pos (it, 0); + unbind_to (count, Qnil); /* Is this a start of a run of characters with box face? @@ -22111,10 +22117,17 @@ extend_face_to_end_of_line (struct it *it) || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0)) return; + ptrdiff_t count = SPECPDL_INDEX (); + + /* Don't allow the user to quit out of face-merging code, in case + this is called when redisplaying a non-selected window, with + point temporarily moved to window-point. */ + specbind (Qinhibit_quit, Qt); const int extend_face_id = (it->face_id == DEFAULT_FACE_ID || it->s != NULL) ? DEFAULT_FACE_ID : face_at_pos (it, LFACE_EXTEND_INDEX); + unbind_to (count, Qnil); /* Face extension extends the background and box of IT->extend_face_id to the end of the line. If the background equals the background |