From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Prefer to split along the longest edge Date: Thu, 19 Dec 2024 11:21:29 +0200 Message-ID: <86h670koyu.fsf@gnu.org> References: <87r06a3yfg.fsf@mail.linkov.net> <87zfkx2ydr.fsf@mail.linkov.net> <8734io2hac.fsf@mail.linkov.net> <86pllrpn2p.fsf@gnu.org> <86o71ao47d.fsf@gnu.org> <874j324fni.fsf@gmail.com> <86ttb0kwgt.fsf@gnu.org> <2aa16454-560c-4d3b-b3eb-e1b780d1b8d6@gmx.at> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6890"; mail-complaints-to="usenet@ciao.gmane.io" Cc: nicolas.despres@gmail.com, rpluim@gmail.com, juri@linkov.net, emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Dec 19 10:22:17 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tOCjZ-0001aZ-Bh for ged-emacs-devel@m.gmane-mx.org; Thu, 19 Dec 2024 10:22:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOCj1-0005iF-LV; Thu, 19 Dec 2024 04:21:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOCj0-0005d0-22 for emacs-devel@gnu.org; Thu, 19 Dec 2024 04:21:42 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOCiz-00089Q-0y; Thu, 19 Dec 2024 04:21:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=C+UjJqbNsNB02eOce31v51LjQF+hzD1IiBz3ix8GF7g=; b=sBWHRWcz9L6e qc1xJjr/i4c4AG8PJFDiebOu49zr/2KSIERjVP56aQSoWDMDQi++Omb+9wHI1x5O0VyHWwXC+7PRL dFaQCINjo4In2bmNTB1/v1YvM8AK4+xDCFoTsTJFWr4cuUPgQR7xZjVJ2dbS6OMaPBf1OSYciYUoX WWDwy06DsVNUXuZcWHU+RgXxdj3xG772AP80rzaiVW+3RoUOOKNyhxTZVsw8ZSGZ2QtHhlS9lAiwM k3o3EKoc6jp/kkPGwEiYcqcl2NZELhzgP42U+4mdu2kAd7r0q21aCH429rfZE9mZNjcO7axLgm+3Q L2qRVmSi0pnZn5KgRJeY2g==; In-Reply-To: <2aa16454-560c-4d3b-b3eb-e1b780d1b8d6@gmx.at> (message from martin rudalics on Thu, 19 Dec 2024 09:52:53 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326711 Archived-At: > Date: Thu, 19 Dec 2024 09:52:53 +0100 > Cc: rpluim@gmail.com, juri@linkov.net, emacs-devel@gnu.org > From: martin rudalics > > > If the split-size threshold of the window dimension determined by > > `split-window-preferred-direction' specifies an integer, the > > corresponding dimension of WINDOW is at least that large, then first > > try splitting window in two along that dimension (one below the other > > if splitting vertically, side by side if splitting horizontally). > > The relevant threshold is `split-height-threshold' when splitting > > vertically, and `split-width-threshold' when splitting horizontally. > > If splitting along the preferred dimension fails, try splitting > > WINDOW along the other dimension. If that also fails, and WINDOW is > > the only window on its frame, try splitting WINDOW vertically > > disregarding the value of `split-height-threshold'. > > > > If splitting succeeds, return the lower window if splitting > > vertically, the right one if splitting horizontally. If splitting > > fails, return nil. > > > > Martin, any comments or corrections to the above doc string? > > It's still hard to read for me. I'd write is as follows: > > The variable `split-window-preferred-direction' prescribes an order of > directions in which Emacs should try to split WINDOW. If that order > mandates to start with a vertical split and `split-height-threshold' > specifies an integer that is at least as large a WINDOW's height, split > WINDOW into two windows one below the other and return the lower one. > If that order mandates to start with a horizontal split and > `split-width-threshold' specifies an integer that is at least as large > as WINDOW's width, split WINDOW into two windows side by side and return > the one on the right. > > In either case, if the first attempt to split WINDOW fails, try to split > the window in the other direction in the same manner as described above. > If that attempts fail too and WINDOW is the only window on its frame, > try splitting WINDOW into two windows one below the other disregarding > the value of `split-height-threshold' and return the window on the > bottom. > > Then the doc-string of 'split-window-preferred-direction' should say > that its value implies an order of operations 'split-window-sensibly' > will try and that that order may depend on the orientation of the frame. > While the frame orientation is processed in 'split-window-sensibly', I > wouldn't mention it there to avoid describing it twice. > > BTW the doc-string of 'split-window-preferred-direction' should also say > that it applies to 'split-window-sensibly' only and not to any other > functions that split windows. Thanks, this is fine by me.