]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bugs caused by running window change functions during redisplay
authorMartin Rudalics <rudalics@gmx.at>
Sat, 2 Feb 2019 08:43:34 +0000 (09:43 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Sat, 2 Feb 2019 08:43:34 +0000 (09:43 +0100)
* src/xdisp.c (redisplay_internal): Run window change
functions before updating the display so changes induced by
these functions can get caught by redisplay (Bug#34138).
* src/window.c (run_window_change_functions): Bind
Qinhibit_redisplay to avoid that the minibuffer window gets
resized while running window change functions (Bug#34179,
Bug#34260).

src/window.c
src/xdisp.c

index 1b474a663a44562b27341389453db05bfec01d26..49d7fc2426ba74d953c8eb88ad9e74df4bf14fcd 100644 (file)
@@ -3710,6 +3710,7 @@ run_window_change_functions (void)
   ptrdiff_t count_outer = SPECPDL_INDEX ();
 
   record_unwind_protect_void (window_change_record);
+  specbind (Qinhibit_redisplay, Qt);
 
   FOR_EACH_FRAME (tail, frame)
     {
index ec8dd8623024cd6931424fdf423df4266ff7a166..b5034b513e6896ab486bf8fa4e9745c681b2b32f 100644 (file)
@@ -14153,6 +14153,9 @@ redisplay_internal (void)
       clear_garbaged_frames ();
     }
 
+  if (!NILP (Vrun_hooks))
+    run_window_change_functions ();
+
   if (windows_or_buffers_changed && !update_mode_lines)
     /* Code that sets windows_or_buffers_changed doesn't distinguish whether
        only the windows's contents needs to be refreshed, or whether the
@@ -14332,18 +14335,6 @@ redisplay_internal (void)
                  && (w = XWINDOW (selected_window)) != sw)
                goto retry;
 
-             if (!NILP (Vrun_hooks))
-               {
-                 run_window_change_functions ();
-
-                 /* If windows or buffers changed or selected_window
-                    changed, redisplay again.  */
-                 if ((windows_or_buffers_changed)
-                     || (WINDOWP (selected_window)
-                         && (w = XWINDOW (selected_window)) != sw))
-                   goto retry;
-               }
-
                /* We used to always goto end_of_redisplay here, but this
                 isn't enough if we have a blinking cursor.  */
              if (w->cursor_off_p == w->last_cursor_off_p)
@@ -14707,18 +14698,6 @@ redisplay_internal (void)
          && (w = XWINDOW (selected_window)) != sw))
     goto retry;
 
-  if (!NILP (Vrun_hooks))
-    {
-      run_window_change_functions ();
-
-      /* If windows or buffers changed or selected_window changed,
-        redisplay again.  */
-      if ((windows_or_buffers_changed)
-         || (WINDOWP (selected_window)
-             && (w = XWINDOW (selected_window)) != sw))
-       goto retry;
-    }
-
   /* Clear the face and image caches.
 
      We used to do this only if consider_all_windows_p.  But the cache