]> code.delx.au - gnu-emacs/blobdiff - src/xdisp.c
Merge from origin/emacs-25
[gnu-emacs] / src / xdisp.c
index dec99478ea5cf62f0aa92580d1cf44959d1d7f2e..b9d496ed556d96e2f48065a16260d455775c432f 100644 (file)
@@ -11793,24 +11793,7 @@ prepare_menu_bars (void)
              && !XBUFFER (w->contents)->text->redisplay)
            continue;
 
-         /* If a window on this frame changed size, report that to
-            the user and clear the size-change flag.  */
-         if (FRAME_WINDOW_SIZES_CHANGED (f))
-           {
-             Lisp_Object functions;
-
-             /* Clear flag first in case we get an error below.  */
-             FRAME_WINDOW_SIZES_CHANGED (f) = false;
-             functions = Vwindow_size_change_functions;
-
-             while (CONSP (functions))
-               {
-                 if (!EQ (XCAR (functions), Qt))
-                   call1 (XCAR (functions), frame);
-                 functions = XCDR (functions);
-               }
-           }
-
+         run_window_size_change_functions (frame);
          menu_bar_hooks_run = update_menu_bar (f, false, menu_bar_hooks_run);
 #ifdef HAVE_WINDOW_SYSTEM
          update_tool_bar (f, false);
@@ -13606,24 +13589,12 @@ redisplay_internal (void)
         it's too late for the hooks in window-size-change-functions,
         which have been examined already in prepare_menu_bars.  So in
         that case we call the hooks here only for the selected frame.  */
-      if (sf->redisplay && FRAME_WINDOW_SIZES_CHANGED (sf))
+      if (sf->redisplay)
        {
-         Lisp_Object functions;
          ptrdiff_t count1 = SPECPDL_INDEX ();
 
          record_unwind_save_match_data ();
-
-         /* Clear flag first in case we get an error below.  */
-         FRAME_WINDOW_SIZES_CHANGED (sf) = false;
-         functions = Vwindow_size_change_functions;
-
-         while (CONSP (functions))
-           {
-             if (!EQ (XCAR (functions), Qt))
-               call1 (XCAR (functions), selected_frame);
-             functions = XCDR (functions);
-           }
-
+         run_window_size_change_functions (selected_frame);
          unbind_to (count1, Qnil);
        }
 
@@ -13645,22 +13616,10 @@ redisplay_internal (void)
     {
       if (sf->redisplay)
        {
-         Lisp_Object functions;
          ptrdiff_t count1 = SPECPDL_INDEX ();
 
          record_unwind_save_match_data ();
-
-         /* Clear flag first in case we get an error below.  */
-         FRAME_WINDOW_SIZES_CHANGED (sf) = false;
-         functions = Vwindow_size_change_functions;
-
-         while (CONSP (functions))
-           {
-             if (!EQ (XCAR (functions), Qt))
-               call1 (XCAR (functions), selected_frame);
-             functions = XCDR (functions);
-           }
-
+         run_window_size_change_functions (selected_frame);
          unbind_to (count1, Qnil);
        }
 
@@ -14037,9 +13996,6 @@ redisplay_internal (void)
     }
   else if (FRAME_VISIBLE_P (sf) && !FRAME_OBSCURED_P (sf))
     {
-      Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf);
-      struct frame *mini_frame;
-
       displayed_buffer = XBUFFER (XWINDOW (selected_window)->contents);
       /* Use list_of_error, not Qerror, so that
         we catch only errors and don't run the debugger.  */
@@ -14047,8 +14003,8 @@ redisplay_internal (void)
                                 list_of_error,
                                 redisplay_window_error);
       if (update_miniwindow_p)
-       internal_condition_case_1 (redisplay_window_1, mini_window,
-                                  list_of_error,
+       internal_condition_case_1 (redisplay_window_1,
+                                  FRAME_MINIBUF_WINDOW (sf), list_of_error,
                                   redisplay_window_error);
 
       /* Compare desired and current matrices, perform output.  */
@@ -14098,8 +14054,8 @@ redisplay_internal (void)
         have put text on a frame other than the selected one, so the
         above call to update_frame would not have caught it.  Catch
         it here.  */
-      mini_window = FRAME_MINIBUF_WINDOW (sf);
-      mini_frame = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
+      Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf);
+      struct frame *mini_frame = XFRAME (WINDOW_FRAME (XWINDOW (mini_window)));
 
       if (mini_frame != sf && FRAME_WINDOW_P (mini_frame))
        {
@@ -16089,6 +16045,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
   bool last_line_misfit = false;
   ptrdiff_t beg_unchanged, end_unchanged;
   int frame_line_height;
+  bool use_desired_matrix;
 
   SET_TEXT_POS (lpoint, PT, PT_BYTE);
   opoint = lpoint;
@@ -16811,7 +16768,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p)
   startp = run_window_scroll_functions (window, it.current.pos);
 
   /* Redisplay the window.  */
-  bool use_desired_matrix = false;
+  use_desired_matrix = false;
   if (!current_matrix_up_to_date_p
       || windows_or_buffers_changed
       || f->cursor_type_changed
@@ -31454,16 +31411,6 @@ If nil, disable message logging.  If t, log messages but don't truncate
 the buffer when it becomes large.  */);
   Vmessage_log_max = make_number (1000);
 
-  DEFVAR_LISP ("window-size-change-functions", Vwindow_size_change_functions,
-    doc: /* Functions called during redisplay, if window sizes have changed.
-The value should be a list of functions that take one argument.
-During the first part of redisplay, for each frame, if any of its windows
-have changed size since the last redisplay, or have been split or deleted,
-all the functions in the list are called, with the frame as argument.
-If redisplay decides to resize the minibuffer window, it calls these
-functions on behalf of that as well.  */);
-  Vwindow_size_change_functions = Qnil;
-
   DEFVAR_LISP ("window-scroll-functions", Vwindow_scroll_functions,
     doc: /* List of functions to call before redisplaying a window with scrolling.
 Each function is called with two arguments, the window and its new