emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 130d47b: Another fix for quitting while displaying non-selected w


From: Eli Zaretskii
Subject: master 130d47b: Another fix for quitting while displaying non-selected windows
Date: Tue, 17 Aug 2021 14:31:15 -0400 (EDT)

branch: master
commit 130d47bdccee31d9fd9d74e273443416d2da20fa
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    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)
---
 src/xdisp.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/xdisp.c b/src/xdisp.c
index 972b901..3b7ed2b 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]