From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 09 04:34:02 2015 Received: (at submit) by debbugs.gnu.org; 9 Nov 2015 09:34:02 +0000 Received: from localhost ([127.0.0.1]:58208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zvipu-0006jv-3R for submit@debbugs.gnu.org; Mon, 09 Nov 2015 04:34:02 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37864) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zvips-0006jV-7F for submit@debbugs.gnu.org; Mon, 09 Nov 2015 04:34:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvipr-0006j0-66 for submit@debbugs.gnu.org; Mon, 09 Nov 2015 04:33:59 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvipr-0006iw-3C for submit@debbugs.gnu.org; Mon, 09 Nov 2015 04:33:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvipq-0003dF-7K for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2015 04:33:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvipn-0006iQ-1L for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2015 04:33:58 -0500 Received: from mail.muc.de ([193.149.48.3]:56966) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvipm-0006iJ-OQ for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2015 04:33:54 -0500 Received: (qmail 74500 invoked by uid 3782); 9 Nov 2015 09:33:52 -0000 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 10:33:51 +0100 Received: (qmail 2353 invoked by uid 1000); 9 Nov 2015 09:35:47 -0000 Date: Mon, 9 Nov 2015 09:35:46 +0000 To: bug-gnu-emacs@gnu.org Subject: Redisplay: after echo area diminishes in size, Follow Mode windows aren't resynchronised. Message-ID: <20151109093546.GA2284@acm.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) Hello, Emacs. With a recent copy of the git master, in either X windows or a Linux tty, emacs -Q If necessary, make the window wide with the mouse. C-x C-f src/xdisp.c ; or any other non-small file. C-x 3 M-x follow-mode Note the content of the lines around the window division. M-: (message "x\ny\nz") The echo area expands, and the two Follow Mode windows get correctly synchronised. Again, note the content of the lines around the window division. C-f The echo area shrinks back to its normal size. Note the content of the lines around the window division. The two lines at the bottom of the left hand window are also displayed at the top of the right hand window. The windows have NOT been synchronised after the change in the echo area size. This is a bug. ######################################################################### Tentative analysis: Follow Mode puts a function on window-scroll-functions which should be called any time 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. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 09 05:04:40 2015 Received: (at 21869) by debbugs.gnu.org; 9 Nov 2015 10:04:40 +0000 Received: from localhost ([127.0.0.1]:58236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvjJX-0000ec-Q5 for submit@debbugs.gnu.org; Mon, 09 Nov 2015 05:04:40 -0500 Received: from mout.gmx.net ([212.227.17.20]:64965) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvjJD-0000e9-6b for 21869@debbugs.gnu.org; Mon, 09 Nov 2015 05:04:37 -0500 Received: from [192.168.1.100] ([213.162.68.49]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Ldcv0-1aeNRz3fbW-00ije5; Mon, 09 Nov 2015 11:04:18 +0100 Message-ID: <56406FA0.8090601@gmx.at> Date: Mon, 09 Nov 2015 11:04:16 +0100 From: martin rudalics MIME-Version: 1.0 To: Alan Mackenzie , 21869@debbugs.gnu.org, Pip Cet Subject: Re: bug#21869: Redisplay: after echo area diminishes in size, Follow Mode windows aren't resynchronised. References: <20151109093546.GA2284@acm.fritz.box> In-Reply-To: <20151109093546.GA2284@acm.fritz.box> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:r2u2212DJSKNLTgrnQtwcfljgqlzUxgwA3FRKpeUHuVwXqnHDgd /UA1tcbK3O94VQKKJSjAMXSzjlofG+weymkpJ4+q/3PaB7wtGchD5JlOYwX9CkDCyvJJS5d KdINHHbKS88Ci723PkszWQ6sthIPbx3LoManA+wVxLzaJsCOo6VF/3bLjHpKnYvIBeX0ulD 5zrHDcW5CnzDAn+t8Re5g== X-UI-Out-Filterresults: notjunk:1;V01:K0:1/5xVsmCZow=:abuuwWscTW0pnYVE6+hmDa kiQzraoo2p97Z3VJ5+LWQFXFF0YpZEORMZHGc9yNhN3Qs37Ptrs/QSupvG8qUO3XNOx7w5amN xWfcCuTzSoZXTOSQPcdwoABziSoa+aA8Y1FMbei4z28/r9X5i7FRb7D1bp4VnRNCnotkG2BEF ueCLKcpyV7MS/Z05SftbKmC4YWEdBRBhG0KG2sjV7BPf757Z1T7v+qQDs3Rm6f0/N015m7HCp igdfk+QEO656ly7i4WlXL7Rtqs2+JaYk2A84cayZggk6Sw7hUrZGycPiDG9s/tjlgqLBMdmnA GcWYopWHWqWy0HupLW+QBUKhtTWb+vi5X/gQfTTG4V2Qc2wKkrH6o5h4qVKGkqHRhPyIw4z7u ZoBKtRy2rOE61F8i+9fN5FbruLWU3nKosz25PR+vQbyxGobhJS6UdcGfD9TtX6p0oZDlDfFJw 03XtJ6+WskyBSJ3EwXpi2EEwXyEDrUtTHz5s3RM8OMzfUiDXQoVW+xcI5gmnx/5mi796qcTQf 4IJ/RsEvSgKaWxpHoF8LemFJQvWwGfT57V2bJleTwMdCwju9csIIr3jX9/iLXIpMAuhLv0LAi FonS2JyeXsTXG1ZIiPQ9UJnmTLvGsxYx//XopODhBTzTNLLiv3NUoX7axXSozqP63N8To00IJ 2aVY/2ma07LyyYhPpjn0WN+5vqyAn+EGASLGfAHP6AOpuMX62UlipreEw9iSjnHXvB9kFOUnx sP6Dqapr7IgycyD56cYMvjjMHc48+iuFPoBLEZTBz/6jsv6TrDVyGrczmK7PoMsyz7eRsIzJ1 wefJfXrstGMi2ZzaE7YMuhi67givA== X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 21869 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) > Follow Mode puts a function on window-scroll-functions which should be= I suppose you mean =91window-size-change-functions=92. > called any time Not really. > 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 resi= zed > 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? martin From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 09 06:13:33 2015 Received: (at 21869) by debbugs.gnu.org; 9 Nov 2015 11:13:33 +0000 Received: from localhost ([127.0.0.1]:58270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvkOD-0002GE-2L for submit@debbugs.gnu.org; Mon, 09 Nov 2015 06:13:33 -0500 Received: from mail.muc.de ([193.149.48.3]:14986) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvkNs-0002Fm-Ls for 21869@debbugs.gnu.org; Mon, 09 Nov 2015 06:13:31 -0500 Received: (qmail 97475 invoked by uid 3782); 9 Nov 2015 11:13:11 -0000 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 12:13:09 +0100 Received: (qmail 2922 invoked by uid 1000); 9 Nov 2015 11:15:05 -0000 Date: Mon, 9 Nov 2015 11:15:05 +0000 To: martin rudalics Subject: Re: bug#21869: Redisplay: after echo area diminishes in size, Follow Mode windows aren't resynchronised. Message-ID: <20151109111505.GB2284@acm.fritz.box> References: <20151109093546.GA2284@acm.fritz.box> <56406FA0.8090601@gmx.at> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56406FA0.8090601@gmx.at> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 21869 Cc: 21869@debbugs.gnu.org, Pip Cet X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello, Martin. On Mon, Nov 09, 2015 at 11:04:16AM +0100, martin rudalics wrote: > > Follow Mode puts a function on window-scroll-functions which should be > I suppose you mean ‘window-size-change-functions’. Yes, that was what I meant. Sorry about the inaccuracy. > > called any time > Not really. > > 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. Yes, probably. What this bug might add to the debate is that here, the misalignment of the windows persists after the echo area returns to its normal size. It is not good that window-size-change-functions gets called when the echo area expands, but not when it shrinks again. This is unsymmetric. > martin -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 09 11:10:40 2015 Received: (at 21869) by debbugs.gnu.org; 9 Nov 2015 16:10:40 +0000 Received: from localhost ([127.0.0.1]:59385 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zvp1k-0002iH-7F for submit@debbugs.gnu.org; Mon, 09 Nov 2015 11:10:40 -0500 Received: from mtaout26.012.net.il ([80.179.55.182]:57058) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zvp1h-0002i8-KH for 21869@debbugs.gnu.org; Mon, 09 Nov 2015 11:10:38 -0500 Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il (HyperSendmail v2007.08) id <0NXK00M00286RZ00@mtaout26.012.net.il> for 21869@debbugs.gnu.org; Mon, 09 Nov 2015 18:13:54 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout26.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NXK00CZG2F5CK90@mtaout26.012.net.il>; Mon, 09 Nov 2015 18:13:54 +0200 (IST) Date: Mon, 09 Nov 2015 18:10:35 +0200 From: Eli Zaretskii Subject: Re: bug#21869: Redisplay: after echo area diminishes in size, Follow Mode windows aren't resynchronised. In-reply-to: <56406FA0.8090601@gmx.at> X-012-Sender: halo1@inter.net.il To: martin rudalics Message-id: <83wptrm9vo.fsf@gnu.org> References: <20151109093546.GA2284@acm.fritz.box> <56406FA0.8090601@gmx.at> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 21869 Cc: acm@muc.de, 21869@debbugs.gnu.org, pipcet@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Mon, 09 Nov 2015 11:04:16 +0100 > From: martin rudalics > > Pip are you still alive? Have your papers arrived? According to the FSF records, the papers did arrive. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 09 13:19:05 2015 Received: (at submit) by debbugs.gnu.org; 9 Nov 2015 18:19:05 +0000 Received: from localhost ([127.0.0.1]:59443 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zvr20-0007Mg-H4 for submit@debbugs.gnu.org; Mon, 09 Nov 2015 13:19:04 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43823) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zvr1g-0007Lw-Mh for submit@debbugs.gnu.org; Mon, 09 Nov 2015 13:19:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvr1c-0001VF-Gx for submit@debbugs.gnu.org; Mon, 09 Nov 2015 13:18:44 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvr1c-0001VB-ED for submit@debbugs.gnu.org; Mon, 09 Nov 2015 13:18:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvr1b-0001EG-CW for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2015 13:18:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zvr1Y-0001UQ-Er for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2015 13:18:39 -0500 Received: from xvm-90.mit.edu ([18.181.2.90]:49419 helo=mod-relay.xvm.mit.edu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zvr1Y-0001UM-BY for bug-gnu-emacs@gnu.org; Mon, 09 Nov 2015 13:18:36 -0500 Received: by mod-relay.xvm.mit.edu (Postfix) id 3689BA38; Mon, 9 Nov 2015 13:18:35 -0500 (EST) Delivered-To: gnu-emacs-bug@moderators.isc.org Received: from mail.muc.de (mail.muc.de [193.149.48.3]) by mod-relay.xvm.mit.edu (Postfix) with ESMTPS id F2CACA05 for ; Mon, 9 Nov 2015 13:18:34 -0500 (EST) Received: (qmail 97054 invoked by uid 8); 9 Nov 2015 18:18:33 -0000 To: gnu-emacs-bug@moderators.isc.org Path: not-for-mail From: Alan Mackenzie Newsgroups: gnu.emacs.bug Subject: Re: bug#21869: Redisplay: after echo area diminishes in size, Follow Mode windows aren't resynchronised. Date: Mon, 9 Nov 2015 18:18:33 +0000 (UTC) Organization: muc.de e.V. Lines: 56 Message-ID: References: NNTP-Posting-Host: news.muc.de X-Trace: colin.muc.de 1447093113 97052 193.149.48.2 (9 Nov 2015 18:18:33 GMT) X-Complaints-To: news-admin@muc.de NNTP-Posting-Date: Mon, 9 Nov 2015 18:18:33 +0000 (UTC) User-Agent: tin/2.3.1-20141224 ("Tallant") (UNIX) (FreeBSD/10.1-RELEASE-p16 (amd64)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.3 (----) Alan Mackenzie wrote: > With a recent copy of the git master, in either X windows or a Linux tty, > emacs -Q > If necessary, make the window wide with the mouse. > C-x C-f src/xdisp.c ; or any other non-small file. > C-x 3 > M-x follow-mode > Note the content of the lines around the window division. > M-: (message "x\ny\nz") > The echo area expands, and the two Follow Mode windows get correctly > synchronised. Again, note the content of the lines around the window > division. > C-f > The echo area shrinks back to its normal size. Note the content of the > lines around the window division. The two lines at the bottom of the > left hand window are also displayed at the top of the right hand window. > The windows have NOT been synchronised after the change in the echo area > size. This is a bug. > ######################################################################### > Tentative analysis: > Follow Mode puts a function on window-size-change-functions which should be > called any time 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. I withdraw my complaint: the doc of w-s-c-functions says it is called BEFORE REDISPLAY when a window size has changed. It says nothing about being called when the window sizes change DURING redisplay. However, that leaves a gap: how is application software to be informed that this change in window sizes has happened? Perhaps changing the hook's definition, such that it would be invoked both before redisplay and during it would be a neat solution. It seems that the chances of the hook being invoked twice on a redisplay cycle would not be high. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 09 14:40:10 2015 Received: (at 21869) by debbugs.gnu.org; 9 Nov 2015 19:40:11 +0000 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 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 Received: (qmail 25246 invoked by uid 3782); 9 Nov 2015 19:40:05 -0000 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 Received: (qmail 7148 invoked by uid 1000); 9 Nov 2015 19:42:00 -0000 Date: Mon, 9 Nov 2015 19:42:00 +0000 To: martin rudalics Subject: Re: bug#21869: [Patch] Redisplay: after echo area diminishes in size, Follow Mode windows aren't resynchronised. Message-ID: <20151109194200.GE2284@acm.fritz.box> References: <20151109093546.GA2284@acm.fritz.box> <56406FA0.8090601@gmx.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 21869 Cc: 21869@debbugs.gnu.org, Pip Cet X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) 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). From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 09 15:51:21 2015 Received: (at 21869) by debbugs.gnu.org; 9 Nov 2015 20:51:21 +0000 Received: from localhost ([127.0.0.1]:59510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvtPM-0002Zr-QW for submit@debbugs.gnu.org; Mon, 09 Nov 2015 15:51:21 -0500 Received: from mtaout25.012.net.il ([80.179.55.181]:50449) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvtP1-0002Z9-Hu for 21869@debbugs.gnu.org; Mon, 09 Nov 2015 15:51:19 -0500 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NXK00J00F1J2W00@mtaout25.012.net.il> for 21869@debbugs.gnu.org; Mon, 09 Nov 2015 22:48:36 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NXK00I48F503O10@mtaout25.012.net.il>; Mon, 09 Nov 2015 22:48:36 +0200 (IST) Date: Mon, 09 Nov 2015 22:50:57 +0200 From: Eli Zaretskii Subject: Re: bug#21869: [Patch] Redisplay: after echo area diminishes in size, Follow Mode windows aren't resynchronised. In-reply-to: <20151109194200.GE2284@acm.fritz.box> X-012-Sender: halo1@inter.net.il To: Alan Mackenzie Message-id: <83egfynbgu.fsf@gnu.org> References: <20151109093546.GA2284@acm.fritz.box> <56406FA0.8090601@gmx.at> <20151109194200.GE2284@acm.fritz.box> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 21869 Cc: rudalics@gmx.at, 21869@debbugs.gnu.org, pipcet@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Mon, 9 Nov 2015 19:42:00 +0000 > From: Alan Mackenzie > Cc: 21869@debbugs.gnu.org, Pip Cet > > > 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? We had a patch in bug #21333 which was discussed and tested at length. Please see if it works for your use case as well. If not, please tell why not. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 09 16:41:31 2015 Received: (at control) by debbugs.gnu.org; 9 Nov 2015 21:41:31 +0000 Received: from localhost ([127.0.0.1]:59525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvuBu-0003nK-97 for submit@debbugs.gnu.org; Mon, 09 Nov 2015 16:41:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50109) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvuBs-0003nA-4e for control@debbugs.gnu.org; Mon, 09 Nov 2015 16:41:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvuBr-0003oi-C8 for control@debbugs.gnu.org; Mon, 09 Nov 2015 16:41:27 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50369) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvuBr-0003oZ-93 for control@debbugs.gnu.org; Mon, 09 Nov 2015 16:41:27 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1ZvuBr-0000Z4-0Y for control@debbugs.gnu.org; Mon, 09 Nov 2015 16:41:27 -0500 Subject: control message for bug 21869 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Mon, 09 Nov 2015 16:41:27 -0500 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.3 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) merge 830 21869 From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 10 08:48:25 2015 Received: (at 21869) by debbugs.gnu.org; 10 Nov 2015 13:48:25 +0000 Received: from localhost ([127.0.0.1]:59839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zw9Hd-0005Yj-4k for submit@debbugs.gnu.org; Tue, 10 Nov 2015 08:48:25 -0500 Received: from mail.muc.de ([193.149.48.3]:31861) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zw9HI-0005YG-UH for 21869@debbugs.gnu.org; Tue, 10 Nov 2015 08:48:24 -0500 Received: (qmail 52318 invoked by uid 3782); 10 Nov 2015 13:48:03 -0000 Received: from acm.muc.de (p579E9232.dip0.t-ipconnect.de [87.158.146.50]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 10 Nov 2015 14:48:01 +0100 Received: (qmail 3494 invoked by uid 1000); 10 Nov 2015 13:49:58 -0000 Date: Tue, 10 Nov 2015 13:49:58 +0000 To: Eli Zaretskii Subject: Re: bug#21869: [Patch] Redisplay: after echo area diminishes in size, Follow Mode windows aren't resynchronised. Message-ID: <20151110134958.GE2626@acm.fritz.box> References: <20151109093546.GA2284@acm.fritz.box> <56406FA0.8090601@gmx.at> <20151109194200.GE2284@acm.fritz.box> <83egfynbgu.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83egfynbgu.fsf@gnu.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: 21869 Cc: rudalics@gmx.at, 21869@debbugs.gnu.org, pipcet@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) Hello, Eli. On Mon, Nov 09, 2015 at 10:50:57PM +0200, Eli Zaretskii wrote: > > Date: Mon, 9 Nov 2015 19:42:00 +0000 > > From: Alan Mackenzie > > Cc: 21869@debbugs.gnu.org, Pip Cet > > > 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? > We had a patch in bug #21333 which was discussed and tested at > length. Please see if it works for your use case as well. If not, > please tell why not. I had to struggle with the posts in that bug archive. I'm not entirely certain whether there was more than one patch in the thread, and if so whether I tried out the one you mean. For clarity, the patch I tried was the one from Pip Cet's opening post in the thread, this one: ######################################################################### >From 243be700591979554e61bbdff0f00f30cc386f7b Mon Sep 17 00:00:00 2001 From: Philip Date: Sun, 23 Aug 2015 21:46:42 +0000 Subject: [PATCH] Call `window-size-change-functions' after mini-window size changes. * window.c (resize_frame_windows): Set FRAME_WINDOW_SIZES_CHANGED flag. (grow_mini_window): Likewise. (shrink_mini_window): Likewise. --- src/window.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/window.c b/src/window.c index 863a792..68bc9e5 100644 --- a/src/window.c +++ b/src/window.c @@ -4094,6 +4094,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag, bool pixelwise) } fset_redisplay (f); + FRAME_WINDOW_SIZES_CHANGED (f) = true; } @@ -4531,6 +4532,7 @@ grow_mini_window (struct window *w, int delta, bool pixelwise) /* Enforce full redisplay of the frame. */ /* FIXME: Shouldn't window--resize-root-window-vertically do it? */ fset_redisplay (f); + FRAME_WINDOW_SIZES_CHANGED (f) = true; adjust_frame_glyphs (f); unblock_input (); } @@ -4570,6 +4572,7 @@ shrink_mini_window (struct window *w, bool pixelwise) /* Enforce full redisplay of the frame. */ /* FIXME: Shouldn't window--resize-root-window-vertically do it? */ fset_redisplay (f); + FRAME_WINDOW_SIZES_CHANGED (f) = true; adjust_frame_glyphs (f); unblock_input (); } ######################################################################### This patch didn't solve my problem. I think the reason is that window-size-change-functions is called at the start of redisplay, but the shrinking of the echo area back to 1 line only takes place later. Hence there is no way that window-size-change-functions can then be invoked. In my proposed change, I change the definition of w-s-c-functions, so that they get called both when a user action has changed window sizes (as at present) and when redisplay changes the echo area/minibuffer size. > Thanks. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 16 10:02:05 2015 Received: (at 21869) by debbugs.gnu.org; 16 Nov 2015 15:02:05 +0000 Received: from localhost ([127.0.0.1]:40365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZyLIC-0008Rc-TX for submit@debbugs.gnu.org; Mon, 16 Nov 2015 10:02:05 -0500 Received: from mail.muc.de ([193.149.48.3]:61835) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZyLIA-0008RI-9H for 21869@debbugs.gnu.org; Mon, 16 Nov 2015 10:02:03 -0500 Received: (qmail 11804 invoked by uid 3782); 16 Nov 2015 15:02:00 -0000 Received: from acm.muc.de (p548A4EBB.dip0.t-ipconnect.de [84.138.78.187]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 16 Nov 2015 16:01:59 +0100 Received: (qmail 7457 invoked by uid 1000); 16 Nov 2015 15:03:57 -0000 Date: Mon, 16 Nov 2015 15:03:57 +0000 To: Eli Zaretskii Subject: Re: bug#21869: [Patch] Redisplay: after echo area diminishes in size, Follow Mode windows aren't resynchronised. Message-ID: <20151116150357.GA7344@acm.fritz.box> References: <20151109093546.GA2284@acm.fritz.box> <56406FA0.8090601@gmx.at> <20151109194200.GE2284@acm.fritz.box> <83egfynbgu.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83egfynbgu.fsf@gnu.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.8 (/) X-Debbugs-Envelope-To: 21869 Cc: rudalics@gmx.at, 21869@debbugs.gnu.org, pipcet@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) Hello, Eli. On Mon, Nov 09, 2015 at 10:50:57PM +0200, Eli Zaretskii wrote: > > Date: Mon, 9 Nov 2015 19:42:00 +0000 > > From: Alan Mackenzie > > Cc: 21869@debbugs.gnu.org, Pip Cet > > > Probably bug#830 and bug#21333. > > > Pip are you still alive? Have your papers arrived? Quick summary of the bug: with Follow Mode active, with a multi-line display in the echo area, do C-f. The echo area resizes to one line, but the Follow Mode windows don't get resynchronised. Quick summary of the cause: redisplay_internal calls prepare_menu_bars (which invokes the window-size-change-functions hook) before it calls echo_area_display (which resizes the echo area). Thus changes to the echo area size aren't yet in place when window-size-change-functions is invoked. > We had a patch in bug #21333 which was discussed and tested at > length. Please see if it works for your use case as well. If not, > please tell why not. As I said last week, this patch didn't work, for the reasons outlined above. I propose the following strategy to fix the bug: 1. Call resize_mini_window from redisplay_internaal before the call to prepare_menu_bars. 2. Remove the call to resize_mini_window from display_echo_area_1, and make that function of type void. 3. Change the contract of echo_area_display, such that the echo area must have been set to the correct height before calling it. 4. Adapt message3_nolog (the only other function which calls echo_area_display) to call resize_mini_window. As a result of these changes, any change in the size of the echo area would be taken into account when invoking window-size-change-functions. An advantage of this change is that a recursive invocation of redisplay_internal inside echo_area_display could be removed, improving performance. If it would help, I could post an analysis to support the soundness of the above strategy. What do you think? > Thanks. -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 17 12:54:49 2015 Received: (at 21869) by debbugs.gnu.org; 17 Nov 2015 17:54:49 +0000 Received: from localhost ([127.0.0.1]:42004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZykSu-0006NJ-Mz for submit@debbugs.gnu.org; Tue, 17 Nov 2015 12:54:49 -0500 Received: from mail.muc.de ([193.149.48.3]:59537) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZykSZ-0006Lw-UJ for 21869@debbugs.gnu.org; Tue, 17 Nov 2015 12:54:47 -0500 Received: (qmail 54948 invoked by uid 3782); 17 Nov 2015 17:54:27 -0000 Received: from acm.muc.de (p579E91A5.dip0.t-ipconnect.de [87.158.145.165]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 17 Nov 2015 18:54:25 +0100 Received: (qmail 5103 invoked by uid 1000); 17 Nov 2015 17:56:24 -0000 Date: Tue, 17 Nov 2015 17:56:23 +0000 To: 21869@debbugs.gnu.org Subject: Re: bug#21869: [Patch] Redisplay: after echo area diminishes in size, Follow Mode windows aren't resynchronised. Message-ID: <20151117175623.GA5077@acm.fritz.box> References: <20151109093546.GA2284@acm.fritz.box> <56406FA0.8090601@gmx.at> <20151109194200.GE2284@acm.fritz.box> <83egfynbgu.fsf@gnu.org> <20151116150357.GA7344@acm.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151116150357.GA7344@acm.fritz.box> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -0.6 (/) X-Debbugs-Envelope-To: 21869 Cc: rudalics@gmx.at, Eli Zaretskii , pipcet@gmail.com, 21333@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) On Mon, Nov 16, 2015 at 03:03:57PM +0000, Alan Mackenzie wrote: > On Mon, Nov 09, 2015 at 10:50:57PM +0200, Eli Zaretskii wrote: > > > Date: Mon, 9 Nov 2015 19:42:00 +0000 > > > From: Alan Mackenzie > > > Cc: 21869@debbugs.gnu.org, Pip Cet > > > > Probably bug#830 and bug#21333. > Quick summary of the bug: with Follow Mode active, with a multi-line > display in the echo area, do C-f. The echo area resizes to one line, > but the Follow Mode windows don't get resynchronised. > Quick summary of the cause: redisplay_internal calls prepare_menu_bars > (which invokes the window-size-change-functions hook) before it calls > echo_area_display (which resizes the echo area). Thus changes to the > echo area size aren't yet in place when window-size-change-functions is > invoked. > I propose the following strategy to fix the bug: > 1. Call resize_mini_window from redisplay_internal before the call to > prepare_menu_bars. > 2. Remove the call to resize_mini_window from display_echo_area_1, and > make that function of type void. > 3. Change the contract of echo_area_display, such that the echo area > must have been set to the correct height before calling it. > 4. Adapt message3_nolog (the only other function which calls > echo_area_display) to call resize_mini_window. > As a result of these changes, any change in the size of the echo area > would be taken into account when invoking window-size-change-functions. > An advantage of this change is that a recursive invocation of > redisplay_internal inside echo_area_display could be removed, improving > performance. No it couldn't. That invocation is not a recursive one, it's the main call of redisplay_internal for the message functions. Here is a patch implementing the above scheme. It should also fix bug#21333 (or, at least, go a long way towards fixing it): Invoke window-size-change-functions after changing echo area height. Fixes bug #21869 and probably bug #21333. Separate the resizing of the echo area from the displaying of text in it. This allows window-size-change-functions to be invoked after the former, but before the latter, according to its specification. src/xdisp.c (message3_nolog): Invoke resize_mini_window_1 before calling echo_area_display. (display_echo_area): Change type to (static) void. Change contract such that the echo area must have been resized, if nec., before calling, and that this function doesn't resize. (display_echo_area_1): Now always return false, since the function never resizes. (echo_area_display): Add extra parameter `window_height_changed_p', replacing a local of the same name. The function no longer resizes the echo area. (redisplay_internal): Invoke resize_mini_window_1 before calling prepare_menu_bars (which invokes window-size-change-functions). diff --git a/src/xdisp.c b/src/xdisp.c index 30dfac5..68e56b7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -800,6 +800,9 @@ static int redisplay_mode_lines (Lisp_Object, bool); static void handle_line_prefix (struct it *); static void handle_stop_backwards (struct it *, ptrdiff_t); +static bool with_echo_area_buffer (struct window *, int, + bool (*)(ptrdiff_t, Lisp_Object), + ptrdiff_t, Lisp_Object); static void unwind_with_echo_area_buffer (Lisp_Object); static Lisp_Object with_echo_area_buffer_unwind_data (struct window *); static bool current_message_1 (ptrdiff_t, Lisp_Object); @@ -815,7 +818,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 void echo_area_display (bool); +static void echo_area_display (bool, bool); static void redisplay_windows (Lisp_Object); static void redisplay_window (Lisp_Object, bool); static Lisp_Object redisplay_window_error (Lisp_Object); @@ -10234,8 +10237,10 @@ message3_nolog (Lisp_Object m) /* Get the frame containing the mini-buffer that the selected frame is using. */ Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf); + struct window *mw = XWINDOW (mini_window); Lisp_Object frame = XWINDOW (mini_window)->frame; struct frame *f = XFRAME (frame); + bool window_height_changed_p; if (FRAME_VISIBLE_P (sf) && !FRAME_VISIBLE_P (f)) Fmake_frame_visible (frame); @@ -10253,7 +10258,12 @@ message3_nolog (Lisp_Object m) clear_message (true, true); do_pending_window_change (false); - echo_area_display (true); + if (window_height_changed_p = + with_echo_area_buffer (mw, display_last_displayed_message_p, + resize_mini_window_1, + (intptr_t) mw, Qt)) + FRAME_WINDOW_SIZES_CHANGED (sf) = true; + echo_area_display (true, window_height_changed_p); do_pending_window_change (false); if (FRAME_TERMINAL (f)->frame_up_to_date_hook) (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f); @@ -10711,15 +10721,15 @@ setup_echo_area_for_printing (bool multibyte_p) } -/* Display an echo area message in window W. Value is true if W's - height is changed. If display_last_displayed_message_p, - display the message that was last displayed, otherwise - display the current message. */ +/* Display an echo area message in window W. If + display_last_displayed_message_p, display the message that was last + displayed, otherwise display the current message. The window + height of W must already have been set for the message. */ -static bool +static void display_echo_area (struct window *w) { - bool no_message_p, window_height_changed_p; + bool no_message_p; /* Temporarily disable garbage collections while displaying the echo area. This is done because a GC can print a message itself. @@ -10735,24 +10745,22 @@ display_echo_area (struct window *w) bool i = display_last_displayed_message_p; no_message_p = NILP (echo_area_buffer[i]); - window_height_changed_p - = with_echo_area_buffer (w, display_last_displayed_message_p, - display_echo_area_1, - (intptr_t) w, Qnil); + with_echo_area_buffer (w, display_last_displayed_message_p, + display_echo_area_1, + (intptr_t) w, Qnil); if (no_message_p) echo_area_buffer[i] = Qnil; unbind_to (count, Qnil); - return window_height_changed_p; } /* Helper for display_echo_area. Display the current buffer which contains the current echo area message in window W, a mini-window, - a pointer to which is passed in A1. A2..A4 are currently not used. - Change the height of W so that all of the message is displayed. - Value is true if height of W was changed. */ + a pointer to which is passed in A1. The height of W must already + have been set to the correct height for the message. Always + returns false. */ static bool display_echo_area_1 (ptrdiff_t a1, Lisp_Object a2) @@ -10767,11 +10775,6 @@ display_echo_area_1 (ptrdiff_t a1, Lisp_Object a2) here. */ forget_escape_and_glyphless_faces (); - /* Do this before displaying, so that we have a large enough glyph - matrix for the display. If we can't get enough space for the - whole text, display the last N lines. That works by setting w->start. */ - bool window_height_changed_p = resize_mini_window (w, false); - /* Use the starting position chosen by resize_mini_window. */ SET_TEXT_POS_FROM_MARKER (start, w->start); @@ -10780,7 +10783,7 @@ display_echo_area_1 (ptrdiff_t a1, Lisp_Object a2) XSETWINDOW (window, w); try_window (window, start, 0); - return window_height_changed_p; + return false; } @@ -11196,16 +11199,17 @@ clear_garbaged_frames (void) } -/* Redisplay the echo area of the selected frame. If UPDATE_FRAME_P, update - selected_frame. */ +/* Redisplay the echo area of the selected frame. If UPDATE_FRAME_P, + update selected_frame. WINDOW_HEIGHT_CHANGED_P states whether the + echo area's height has just been changed. It is ignored unless + UPDATE_FRAME_P is true. */ static void -echo_area_display (bool update_frame_p) +echo_area_display (bool update_frame_p, bool window_height_changed_p) { Lisp_Object mini_window; struct window *w; struct frame *f; - bool window_height_changed_p = false; struct frame *sf = SELECTED_FRAME (); mini_window = FRAME_MINIBUF_WINDOW (sf); @@ -11230,7 +11234,7 @@ echo_area_display (bool update_frame_p) if (!NILP (echo_area_buffer[0]) || minibuf_level == 0) { echo_area_window = mini_window; - window_height_changed_p = display_echo_area (w); + display_echo_area (w); w->must_be_updated_p = true; /* Update the display, unless called from redisplay_internal. @@ -13497,6 +13501,19 @@ redisplay_internal (void) /* Clear frames marked as garbaged. */ clear_garbaged_frames (); + /* Resize the echo area, if needed, before the invocation of + window-size-change-functions. */ + { + Lisp_Object mini_window = FRAME_MINIBUF_WINDOW (sf); + struct window *mw = XWINDOW (mini_window); + + if (!MINI_WINDOW_P (XWINDOW (selected_window)) + && with_echo_area_buffer (mw, display_last_displayed_message_p, + resize_mini_window_1, + (intptr_t) mw, Qnil)) + FRAME_WINDOW_SIZES_CHANGED (sf) = true; + } + /* Build menubar and tool-bar items. */ if (NILP (Vmemory_full)) prepare_menu_bars (); @@ -13534,7 +13551,7 @@ redisplay_internal (void) echo-area doesn't show through. */ && !MINI_WINDOW_P (XWINDOW (selected_window)))) { - echo_area_display (false); + echo_area_display (false, false); if (message_cleared_p) update_miniwindow_p = true; -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 21 11:02:54 2015 Received: (at 21869-done) by debbugs.gnu.org; 21 Nov 2015 16:02:54 +0000 Received: from localhost ([127.0.0.1]:47219 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a0Acn-0001M4-SQ for submit@debbugs.gnu.org; Sat, 21 Nov 2015 11:02:54 -0500 Received: from mtaout22.012.net.il ([80.179.55.172]:42367) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a0Ack-0001Lo-Oe; Sat, 21 Nov 2015 11:02:51 -0500 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NY600K009WPI700@a-mtaout22.012.net.il>; Sat, 21 Nov 2015 18:02:49 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NY600KPD9WOHJ00@a-mtaout22.012.net.il>; Sat, 21 Nov 2015 18:02:49 +0200 (IST) Date: Sat, 21 Nov 2015 18:02:39 +0200 From: Eli Zaretskii Subject: Re: bug#19576: write-file writes the wrong buffer In-reply-to: <20151121155658.GA3636@acm.fritz.box> X-012-Sender: halo1@inter.net.il To: 21333-done@debbugs.gnu.org, 21869-done@debbugs.gnu.org Message-id: <83a8q749y8.fsf@gnu.org> References: <564A3292.2050807@gmx.at> <87fv05phpw.fsf@mail.linkov.net> <20151117200204.GA5054@acm.fritz.box> <83lh9v9p7k.fsf@gnu.org> <20151118232304.GB1690@acm.fritz.box> <83mvua7z8k.fsf@gnu.org> <83k2pb4mc9.fsf@gnu.org> <20151121155658.GA3636@acm.fritz.box> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 21869-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Date: Sat, 21 Nov 2015 15:56:58 +0000 > Cc: 19576@debbugs.gnu.org, andlind@gmail.com, juri@linkov.net > From: Alan Mackenzie > > Hello, Eli. > > On Sat, Nov 21, 2015 at 01:35:02PM +0200, Eli Zaretskii wrote: > > > Date: Thu, 19 Nov 2015 18:03:39 +0200 > > > From: Eli Zaretskii > > > Cc: 19576@debbugs.gnu.org, andlind@gmail.com, juri@linkov.net > > > > > Date: Wed, 18 Nov 2015 23:23:04 +0000 > > > > Cc: martin rudalics , juri@linkov.net, andlind@gmail.com, > > > > 19576@debbugs.gnu.org > > > > From: Alan Mackenzie > > > > > > Could you try a simpler patch below? It seems to fix both your test > > > > > case and the one originally reported in bug#21333. > > > > > It does indeed fix my test case (I haven't tried it on #21333). However > > > > it violates the specification of window-size-change-functions, which > > > > says that the hook is called _before_ redisplay, not after it has > > > > started. I suppose one could argue over what "redisplay" means here, > > > > but intuitively I would say it is the putting of glyphs into matrices. > > > > "Redisplay" is indeed not defined well enough, but the only reasonable > > > interpretation of "before redisplay" is that it happens before the > > > call to redisplay_internal. And this is false for your suggested > > > solution as well. It is false even by your definition, because > > > prepare_menu_bars already manipulates the glyph matrices, the ones it > > > creates for the tool bar (and also menu bar on some display types). > > > And display_echo_area also manipulates glyph matrices (it calls > > > try_window). > > > > Which is only logical for an event that by itself is triggered as part > > > of redisplay! It's redisplay that decides to resize the mini-window, > > > so calling the hook after that decision _cannot_ possibly count as > > > being "before redisplay". > > > > IOW, once we, by popular demand, decided to call > > > window-size-change-functions when the mini-window is resized, we > > > invalidated that specification. All the other callers of this hook > > > are not part of a redisplay cycle, but this one is, and cannot be > > > anywhere else. > > > > So no matter what change we eventually install, the documentation of > > > the hook needs to be amended to say that it's called "before redisplay > > > or at the beginning of a redisplay cycle", and maybe also mention that > > > the second case is when the mini-window is resized. > > > No further comments, so I've committed the changes I posted here > > earlier. I also modified the documentation to be consistent with what > > the code does. > > Thanks. > > > Please tell me if this bug and bug#21333 could now be closed, or if > > there are any leftovers. > > I don't think this fix concerns #19576. The discussion of #21869 seems, > somehow, to have moved to here. > > But I think that #21333 can be closed, and #21869 certainly can be; both > of these were about window-size-change-functions not getting called for > echo area size changes. Closing. From unknown Tue Jun 17 01:48:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 20 Dec 2015 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator