From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Nicolas_Despr=C3=A8s?= Newsgroups: gmane.emacs.devel Subject: Re: Prefer to split along the longest edge Date: Sat, 14 Dec 2024 16:41:30 +0100 Message-ID: References: <86a5cyv6vt.fsf@gnu.org> <868qsiv3xv.fsf@gnu.org> <86msgytiue.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000002e9f8206293cca05" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20761"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rudalics@gmx.at, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 14 16:43:07 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 1tMUIN-0005Gs-EO for ged-emacs-devel@m.gmane-mx.org; Sat, 14 Dec 2024 16:43:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMUHV-00083w-4z; Sat, 14 Dec 2024 10:42:13 -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 1tMUHT-00083A-Jl for emacs-devel@gnu.org; Sat, 14 Dec 2024 10:42:11 -0500 Original-Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMUHR-00042E-Ci; Sat, 14 Dec 2024 10:42:11 -0500 Original-Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-382610c7116so1326142f8f.0; Sat, 14 Dec 2024 07:42:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734190927; x=1734795727; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NynzSEoeepI5Z9w0g8GibTP5h49NlVgkV9ziJaZrjgU=; b=KuXWk4+xTmS98WcseF8lUGDVZMxaN3tHjM49izFJAlft+3tOt1+gnKZmPpZ0jmNwWb 9YQVnFLKcuOG1CDSg3G1tfbTQFLYcRpMtRBzQ8/WI17L7p+K2fzQJld81ctzbNzNiVGt G9DL3+jdzXfjVFV0rFNlDfgyDAnmZar5sEHvS5BuuDReo+whJlsuuoXWyXXBkrW2ZMNu Wms3nBpsPQuqJvMXHBgXSmxLKXVOuT4GjEog6pA//hiB+V5AoRg7nLEWnux7QFDscEyc LqJIX3HGXFiKWnsE90qJ18D2MG1ayh94j1lqKYaZv2+FRNJCGsNY5QoWIfyVT26m3UEa cT2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734190927; x=1734795727; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NynzSEoeepI5Z9w0g8GibTP5h49NlVgkV9ziJaZrjgU=; b=c17cunMsbOHY4rAOoQBShZufTmTeXtMKsrQDbVCv8uawpnRSWhAyXeXUvDpkn5Q8G6 QCa5pszb0a/hWE7cx7WWRpPNpe3BFKIV6fWGfh1hX01lRv/AVhndtbzS5VSHfoGFq03+ 51vg342t8rKDAKIgzSc1YC4gkCAT0MEXNMDRtRUW2b/jPubizAG+nnIEci6XcpqVGslx o2XGCK1BcDOcOrsQ33+UjQDzBOIJkDTh/DTyP2TVc/qZnspaKLqcOxHw98Dq/yU+3dtY 2CIvDJPuKcZqHUzUuofQRHy8cf4hcUHkgor5p0h+KEg8Mj47udB/iYv5SmBidXDh2DzU qLEg== X-Forwarded-Encrypted: i=1; AJvYcCVreIuQRQURhQfSsNH51KlmlOsPvdYgzC6fUqlClSiCk/7nnj8RgYNIb19UVlyUHEQIeF1J3I/lfuW8uQ==@gnu.org X-Gm-Message-State: AOJu0YxpfbaT4CccsX/TWyYhfg2cLPYswRnwChr1FGhZ87JR4J6x1oqb lRZHRTfwK6PIq+5jSwVaQBIkhcLjCyub1ptQZN+VZfgTcUJRphwlqoi9oIeCRzdrWemxddLXdqP RUblqn+OX8XPknFfLMcWvT2WovqDGCw== X-Gm-Gg: ASbGnct6ReUvbhGzOETonzTerVke3JgRRU8oTWcpjjpBmjrjXK/8VED6gMH0VU60Oty ACORtdt53ZwcDSLgT04RyAEiXOaRgBJmgoip7b1w= X-Google-Smtp-Source: AGHT+IFI6GpBOZ6sTa+1AT3sIoI/wG+9a5YQcRuql0V1PdwIctHqpDPmGKcxjf5OUs1D2aHp/8jvmrtrImFki/CWDdo= X-Received: by 2002:a05:6000:795:b0:385:e5d8:3ef1 with SMTP id ffacd0b85a97d-3888e0b8f92mr5603173f8f.44.1734190927090; Sat, 14 Dec 2024 07:42:07 -0800 (PST) In-Reply-To: <86msgytiue.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=nicolas.despres@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:326494 Archived-At: --0000000000002e9f8206293cca05 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Dec 14, 2024 at 3:55=E2=80=AFPM Eli Zaretskii wrote: > > From: Nicolas Despr=C3=A8s > > Date: Sat, 14 Dec 2024 15:06:40 +0100 > > Cc: rudalics@gmx.at, emacs-devel@gnu.org > > > > > Because these variables define the minimum size to allow splitting, > not the order by which split > > orientations > > > are tried. > > > > Sorry, I don't understand: does it mean you are unable to change the > > value of split-height-threshold to cause the function to split > > horizontally? If so, can you show a recipe? > > > > I can by setting split-height-threshold to nil, but then it will never > split vertically. > > You can also set it to a large enough value, no? > Yes, with the same result of disabling vertical split. > > > The current implementation first tries to split vertically. If it fails= , > it tries to split horizontally then it > > falls back to vertical splitting. > > > > So to split horizontally, it must first fail to split vertically. > > Yes. > > > The default threshold values are fine. I just want the default behavior > to try the longest edge first. > > This way when both splitting would have succeeded (according to their > respective threshold value) it will > > split first where there is more room. > > But N columns are not equivalent to N lines. IOW, if you have a > window that is (N+1)xN, splitting horizontally is not necessarily TRT. > In such a case, both are equally good, I guess. Most generally, Emacs' frames are rectangles rather than squarish. Note that I added a condition when the width is fewer than 80 columns to preserve the historical behavior of Emacs to split vertically first. The condition deciding which orientation is tried first could be further tweaked to accommodate the difference between line height and column width. It could be pixel-based, for instance. My main point is that we can achieve a better default than blindly splitting vertically. --0000000000002e9f8206293cca05 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, Dec 14, 2024 at 3:55= =E2=80=AFPM Eli Zaretskii <eliz@gnu.org<= /a>> wrote:
&= gt; From: Nicolas Despr=C3=A8s <nicolas.despres@gmail.com>
> Date: Sat, 14 Dec 2024 15:06:40 +0100
> Cc: rudalics@gmx.= at, emacs-deve= l@gnu.org
>
>=C2=A0 > Because these variables define the minimum size to allow sp= litting, not the order by which split
>=C2=A0 orientations
>=C2=A0 > are tried.
>
>=C2=A0 Sorry, I don't understand: does it mean you are unable to ch= ange the
>=C2=A0 value of split-height-threshold to cause the function to split >=C2=A0 horizontally?=C2=A0 If so, can you show a recipe?
>
> I can by setting split-height-threshold to nil, but then it will never= split vertically.

You can also set it to a large enough value, no?

<= /div>
Yes, with the s= ame result of disabling vertical split.
=C2=A0

> The current implementation first tries to split vertically. If it fail= s, it tries to split horizontally then it
> falls back to vertical splitting.
>
> So to split horizontally, it must first fail to split vertically.

Yes.

> The default threshold values are fine. I just want the default behavio= r to try the longest edge first.
> This way when both splitting would have succeeded (according to their = respective threshold value) it will
> split first where there is more room.

But N columns are not equivalent to N lines.=C2=A0 IOW, if you have a
window that is (N+1)xN, splitting horizontally is not necessarily TRT.
<= /blockquote>

In such a case, both are equally good, I guess. Most generally, Emac= s' frames are rectangles rather than squarish.

Note that I added a condition when the width = is fewer than 80 columns to preserve the historical behavior of Emacs to sp= lit vertically first.

The= condition deciding which orientation is tried first could be further tweak= ed to accommodate the difference between line height and column width. It c= ould be pixel-based, for instance.

My main point is that we can achieve a better default than bl= indly splitting vertically.

--0000000000002e9f8206293cca05--