aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2021-08-17 21:29:58 +0300
committerEli Zaretskii2021-08-17 21:29:58 +0300
commit130d47bdccee31d9fd9d74e273443416d2da20fa (patch)
tree6dcf7481313290b70d9b568bdbdd556985e09e7e /src
parentc609b4c7287c416e320a1b95f866f1ce1ce7254d (diff)
downloademacs-130d47bdccee31d9fd9d74e273443416d2da20fa.tar.gz
emacs-130d47bdccee31d9fd9d74e273443416d2da20fa.zip
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)
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c13
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)
4472static enum prop_handled 4472static enum prop_handled
4473handle_face_prop (struct it *it) 4473handle_face_prop (struct it *it)
4474{ 4474{
4475 ptrdiff_t count = SPECPDL_INDEX ();
4476 /* Don't allow the user to quit out of face-merging code, in case
4477 this is called when redisplaying a non-selected window, with
4478 point temporarily moved to window-point. */
4479 specbind (Qinhibit_quit, Qt);
4475 const int new_face_id = face_at_pos (it, 0); 4480 const int new_face_id = face_at_pos (it, 0);
4481 unbind_to (count, Qnil);
4476 4482
4477 4483
4478 /* Is this a start of a run of characters with box face? 4484 /* 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)
22111 || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0)) 22117 || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0))
22112 return; 22118 return;
22113 22119
22120 ptrdiff_t count = SPECPDL_INDEX ();
22121
22122 /* Don't allow the user to quit out of face-merging code, in case
22123 this is called when redisplaying a non-selected window, with
22124 point temporarily moved to window-point. */
22125 specbind (Qinhibit_quit, Qt);
22114 const int extend_face_id = (it->face_id == DEFAULT_FACE_ID 22126 const int extend_face_id = (it->face_id == DEFAULT_FACE_ID
22115 || it->s != NULL) 22127 || it->s != NULL)
22116 ? DEFAULT_FACE_ID 22128 ? DEFAULT_FACE_ID
22117 : face_at_pos (it, LFACE_EXTEND_INDEX); 22129 : face_at_pos (it, LFACE_EXTEND_INDEX);
22130 unbind_to (count, Qnil);
22118 22131
22119 /* Face extension extends the background and box of IT->extend_face_id 22132 /* Face extension extends the background and box of IT->extend_face_id
22120 to the end of the line. If the background equals the background 22133 to the end of the line. If the background equals the background