GNU bug report logs - #21869
Redisplay: after echo area diminishes in size, Follow Mode windows aren't resynchronised.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Mon, 9 Nov 2015 09:35:01 UTC

Severity: normal

Merged with 830, 21333

Found in versions 24.0.90, 25.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 21869 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 21869 <at> debbugs.gnu.org, Pip Cet <pipcet <at> gmail.com>
Subject: Re: bug#21869: [Patch] Redisplay: after echo area diminishes in
 size, Follow Mode windows aren't resynchronised.
Date: Mon, 9 Nov 2015 19:42:00 +0000
Hello again, Martin.

On Mon, Nov 09, 2015 at 11:04:16AM +0100, martin rudalics wrote:

>  > a window changes size.  At the C-f above,
>  > window-size-change-functions is not being invoked.

>  > The one single place where window-size-change-functions is invoked is in
>  > the function prepare_menu_bars in xdisp.c.

>  > The one single place where prepare_menu_bars is called is fairly early on
>  > in redisplay_internal, at L+137.  This is before the echo area is resized
>  > at L+164.  Thus, the check on changed window sizes happens too early,
>  > before the change in the echo area size.

> Probably bug#830 and bug#21333.

> Pip are you still alive?  Have your papers arrived?

Here's a proposed fix.  It seems to work.  Do you think there are any
problems with it?



diff --git a/src/xdisp.c b/src/xdisp.c
index bdf2d09..aacbb8a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -11193,13 +11193,15 @@ echo_area_display (bool update_frame_p)
 {
   Lisp_Object mini_window;
   struct window *w;
+  Lisp_Object frame;
   struct frame *f;
   bool window_height_changed_p = false;
   struct frame *sf = SELECTED_FRAME ();
 
   mini_window = FRAME_MINIBUF_WINDOW (sf);
   w = XWINDOW (mini_window);
-  f = XFRAME (WINDOW_FRAME (w));
+  frame = WINDOW_FRAME (w);
+  f = XFRAME (frame);
 
   /* Don't display if frame is invisible or not yet initialized.  */
   if (!FRAME_VISIBLE_P (f) || !f->glyphs_initialized_p)
@@ -11222,6 +11224,19 @@ echo_area_display (bool update_frame_p)
       window_height_changed_p = display_echo_area (w);
       w->must_be_updated_p = true;
 
+      if (window_height_changed_p)
+	{
+	  Lisp_Object functions;
+
+	  functions = Vwindow_size_change_functions;
+	  while (CONSP (functions))
+	    {
+	      if (!EQ (XCAR (functions), Qt))
+		call1 (XCAR (functions), frame);
+	      functions = XCDR (functions);
+	    }
+	}
+
       /* Update the display, unless called from redisplay_internal.
 	 Also don't update the screen during redisplay itself.  The
 	 update will happen at the end of redisplay, and an update
@@ -31121,6 +31136,10 @@ the buffer when it becomes large.  */);
 
   DEFVAR_LISP ("window-size-change-functions", Vwindow_size_change_functions,
     doc: /* Functions called before redisplay, if window sizes have changed.
+The functions are also called during redisplay, if the minibuffer window (and
+hence other windows) change size.  This call happens before the other windows
+are redisplayed.
+
 The value should be a list of functions that take one argument.
 Just before redisplay, for each frame, if any of its windows have changed
 size since the last redisplay, or have been split or deleted,


> martin

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 9 years and 180 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.