From: Stefan Monnier Date: Tue, 8 Sep 2015 14:25:59 +0000 (-0400) Subject: Remove a few simple cases of global redisplay X-Git-Tag: emacs-25.0.90~1224^2~193 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bc26305473ed59fe75b6efc3ba1c967f54c4c292;p=emacs.git Remove a few simple cases of global redisplay * src/dispnew.c (redraw_frame): Don't redisplay all frames. * src/xdisp.c (echo_area_display): Set the frame's `redisplay' bit rather than returning a "resized_p" boolean. (redisplay_internal): Adjust call accordingly. * src/xfaces.c (free_realized_faces): Don't redisplay all frames. (free_all_realized_faces): Set windows_or_buffers_changed so as to ease tracking of this undesirable situation. --- diff --git a/src/dispnew.c b/src/dispnew.c index 18afe50dd9b..645d4106e9e 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -3004,7 +3004,7 @@ redraw_frame (struct frame *f) clear_frame (f); clear_current_matrices (f); update_end (f); - windows_or_buffers_changed = 13; + fset_redisplay (f); /* Mark all windows as inaccurate, so that every window will have its redisplay done. */ mark_window_display_accurate (FRAME_ROOT_WINDOW (f), 0); diff --git a/src/xdisp.c b/src/xdisp.c index 82931b88e1c..6b165af1eb7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -768,7 +768,7 @@ static void push_it (struct it *, struct text_pos *); static void iterate_out_of_display_property (struct it *); static void pop_it (struct it *); static void redisplay_internal (void); -static bool echo_area_display (bool); +static void echo_area_display (bool); static void redisplay_windows (Lisp_Object); static void redisplay_window (Lisp_Object, bool); static Lisp_Object redisplay_window_error (Lisp_Object); @@ -11119,11 +11119,11 @@ clear_garbaged_frames (void) } -/* Redisplay the echo area of the selected frame. If UPDATE_FRAME_P, - update selected_frame. Value is true if the mini-windows height - has been changed. */ +/* Redisplay the echo area of the selected frame. If UPDATE_FRAME_P, update + selected_frame. Value is the affected frame if the mini-windows height has + been changed. */ -static bool +static void echo_area_display (bool update_frame_p) { Lisp_Object mini_window; @@ -11138,14 +11138,14 @@ echo_area_display (bool update_frame_p) /* Don't display if frame is invisible or not yet initialized. */ if (!FRAME_VISIBLE_P (f) || !f->glyphs_initialized_p) - return false; + return; #ifdef HAVE_WINDOW_SYSTEM /* When Emacs starts, selected_frame may be the initial terminal frame. If we let this through, a message would be displayed on the terminal. */ if (FRAME_INITIAL_P (XFRAME (selected_frame))) - return false; + return; #endif /* HAVE_WINDOW_SYSTEM */ /* Redraw garbaged frames. */ @@ -11183,7 +11183,7 @@ echo_area_display (bool update_frame_p) pending input. */ ptrdiff_t count = SPECPDL_INDEX (); specbind (Qredisplay_dont_pause, Qt); - windows_or_buffers_changed = 44; + fset_redisplay (f); redisplay_internal (); unbind_to (count, Qnil); } @@ -11219,7 +11219,16 @@ echo_area_display (bool update_frame_p) if (EQ (mini_window, selected_window)) CHARPOS (this_line_start_pos) = 0; - return window_height_changed_p; + if (window_height_changed_p) + { + fset_redisplay (f); + + /* If window configuration was changed, frames may have been + marked garbaged. Clear them or we will experience + surprises wrt scrolling. + FIXME: How/why/when? */ + clear_garbaged_frames (); + } } /* True if W's buffer was changed but not saved. */ @@ -13445,7 +13454,7 @@ redisplay_internal (void) echo-area doesn't show through. */ && !MINI_WINDOW_P (XWINDOW (selected_window)))) { - bool window_height_changed_p = echo_area_display (false); + echo_area_display (false); if (message_cleared_p) update_miniwindow_p = true; @@ -13458,16 +13467,6 @@ redisplay_internal (void) the echo area. */ if (!display_last_displayed_message_p) message_cleared_p = false; - - if (window_height_changed_p) - { - windows_or_buffers_changed = 50; - - /* If window configuration was changed, frames may have been - marked garbaged. Clear them or we will experience - surprises wrt scrolling. */ - clear_garbaged_frames (); - } } else if (EQ (selected_window, minibuf_window) && (current_buffer->clip_changed || window_outdated (w)) diff --git a/src/xfaces.c b/src/xfaces.c index 03032496381..a4f1aa89f71 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -4186,7 +4186,7 @@ free_realized_faces (struct face_cache *c) if (WINDOWP (f->root_window)) { clear_current_matrices (f); - windows_or_buffers_changed = 58; + fset_redisplay (f); } unblock_input (); @@ -4206,6 +4206,7 @@ free_all_realized_faces (Lisp_Object frame) Lisp_Object rest; FOR_EACH_FRAME (rest, frame) free_realized_faces (FRAME_FACE_CACHE (XFRAME (frame))); + windows_or_buffers_changed = 58; } else free_realized_faces (FRAME_FACE_CACHE (XFRAME (frame)));