From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Window change functions Date: Sat, 05 Jan 2019 09:20:45 +0200 Message-ID: <83sgy71sfm.fsf@gnu.org> References: <5C21FB4B.7030005@gmx.at> <5C249D21.7070508@gmx.at> <83k1jv6k11.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1546672778 5025 195.159.176.226 (5 Jan 2019 07:19:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 5 Jan 2019 07:19:38 +0000 (UTC) Cc: rudalics@gmx.at, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 05 08:19:34 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gfgF3-0001EC-Ft for ged-emacs-devel@m.gmane.org; Sat, 05 Jan 2019 08:19:33 +0100 Original-Received: from localhost ([127.0.0.1]:40413 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfgHA-0004Es-3z for ged-emacs-devel@m.gmane.org; Sat, 05 Jan 2019 02:21:44 -0500 Original-Received: from eggsout.gnu.org ([209.51.188.92]:49769 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfgGa-0004EU-Oy for emacs-devel@gnu.org; Sat, 05 Jan 2019 02:21:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfgGX-000398-Jy for emacs-devel@gnu.org; Sat, 05 Jan 2019 02:21:08 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53131) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfgGX-00038z-F1; Sat, 05 Jan 2019 02:21:05 -0500 Original-Received: from [176.228.60.248] (port=3338 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gfgGX-0007Pz-2m; Sat, 05 Jan 2019 02:21:05 -0500 In-reply-to: (message from Stefan Monnier on Sat, 05 Jan 2019 01:17:57 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232187 Archived-At: > From: Stefan Monnier > Cc: martin rudalics , emacs-devel@gnu.org > Date: Sat, 05 Jan 2019 01:17:57 -0500 > > >> > If it's run "at the end of redisplay", then I think it's too late: those > >> > hooks will often want to change something visual, and they will want it > >> > to appear right away, so it should be run just *before* redisplay. > >> Note that 'window-size-change-functions' are currently already run > >> right in the middle of redisplay. Often, window sizes are correct > >> only *after* redisplay. Think of minibuffer window resizing or > >> changes in the fringes, margins or modeline sub-structures. But a > >> final word on the location of the call will have to be told by Eli. > > I don't think I can utter that final word, primarily because I don't > > understand Stefan's concerns. Stefan, could you please elaborate? > > For example, I have a window-size-change-functions which I use to > re-balance windows (using balance-window-area) after a frame resize. > It doesn't care about the exact window sizes when it's called, so having > correct window sizes when it's called is not necessary. OTOH redisplay > will need to happen right after it was run, because it changes > window sizes. So the best time to run it is right before redisplay. Since redisplay never resizes windows, except when it resizes the mini-window, I don't see how redisplay is relevant to this issue. And if resizing a mini-window is the reason why Martin decided to run this hook at the end of redisplay, we can arrange for an immediate additional redisplay cycle given some special return value of the hook function, then the user will never see an inaccurate display.