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: Zoom: a window management minor mode -- best practices and questions Date: Wed, 02 May 2018 21:58:18 +0300 Message-ID: <83lgd1q3zp.fsf@gnu.org> References: <83muxioten.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1525287426 7889 195.159.176.226 (2 May 2018 18:57:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 2 May 2018 18:57:06 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andrea Cardaci Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 02 20:57:02 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fDww1-0001x7-Ue for ged-emacs-devel@m.gmane.org; Wed, 02 May 2018 20:57:02 +0200 Original-Received: from localhost ([::1]:52185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDwy8-0004VP-ID for ged-emacs-devel@m.gmane.org; Wed, 02 May 2018 14:59:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42744) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDwxZ-0004VE-6N for emacs-devel@gnu.org; Wed, 02 May 2018 14:58:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fDwxW-0003y3-MO for emacs-devel@gnu.org; Wed, 02 May 2018 14:58:37 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52589) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fDwxW-0003xp-Il; Wed, 02 May 2018 14:58:34 -0400 Original-Received: from [176.228.60.248] (port=1207 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fDwxV-0001Qx-Bu; Wed, 02 May 2018 14:58:34 -0400 In-reply-to: (message from Andrea Cardaci on Wed, 2 May 2018 20:41:38 +0200) 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:225038 Archived-At: > From: Andrea Cardaci > Date: Wed, 2 May 2018 20:41:38 +0200 > Cc: emacs-devel@gnu.org > > The handler should be triggered in these cases: > - a window is resized; This is the one I mentioned as missing. > - a window is selected; Hooking select-window will take care of this one. > - a window is created (this is actually included in the "a window is resized" case); If you mean that the selected window is resized as result of creating a new window, then yes, "window is resized" takes care of this. (What about deleting a window, btw?) > - a window changes its buffer (because it's possible to exclude certain windows from zooming so the layout > should be updated accordingly). The hook suggested by Martin should take care of this. > Besides, doesn't this in principle suffer of the same do-something-that-triggers-the-hook-inside-such-hook > problem like `window-size-change-functions`? No, because pre-redisplay-functions are run _before_ anything significant in redisplay, so your chances to confuse redisplay are nil. > > Alternatively, we could provide some control to disable resizing of > > the selected window > > Please elaborate on this point. How can it help this situation? Well, as you said, the main purpose of Zoom is to prevent resizing of the selected window due to Emacs's own considerations. My interpretation of this was that you want to control the size of the selected window, and disallow anything else changing it. So if you change the size at select-window time, and the size is not allowed to change after that, you have reached your purpose, right?