From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: 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 Message-ID: <20151109194200.GE2284@acm.fritz.box> References: <20151109093546.GA2284@acm.fritz.box> <56406FA0.8090601@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1447098097 3315 80.91.229.3 (9 Nov 2015 19:41:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Nov 2015 19:41:37 +0000 (UTC) Cc: 21869@debbugs.gnu.org, Pip Cet To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 09 20:41:26 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZvsJU-0000km-4I for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Nov 2015 20:41:12 +0100 Original-Received: from localhost ([::1]:55220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvsJT-0007xm-As for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Nov 2015 14:41:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvsJO-0007vP-Vz for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2015 14:41:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvsJK-0004XR-Uj for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2015 14:41:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvsJK-0004XM-Re for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2015 14:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZvsJK-0000rr-6O for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2015 14:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Nov 2015 19:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21869 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21869-submit@debbugs.gnu.org id=B21869.14470980113259 (code B ref 21869); Mon, 09 Nov 2015 19:41:02 +0000 Original-Received: (at 21869) by debbugs.gnu.org; 9 Nov 2015 19:40:11 +0000 Original-Received: from localhost ([127.0.0.1]:59471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvsIT-0000qT-Ri for submit@debbugs.gnu.org; Mon, 09 Nov 2015 14:40:10 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:57699) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvsIQ-0000qD-La for 21869@debbugs.gnu.org; Mon, 09 Nov 2015 14:40:08 -0500 Original-Received: (qmail 25246 invoked by uid 3782); 9 Nov 2015 19:40:05 -0000 Original-Received: from acm.muc.de (p579E973C.dip0.t-ipconnect.de [87.158.151.60]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 09 Nov 2015 20:40:04 +0100 Original-Received: (qmail 7148 invoked by uid 1000); 9 Nov 2015 19:42:00 -0000 Content-Disposition: inline In-Reply-To: <56406FA0.8090601@gmx.at> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:108607 Archived-At: 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).