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 15:06:40 +0100 Message-ID: References: <86a5cyv6vt.fsf@gnu.org> <868qsiv3xv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000000dec0106293b778c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35284"; 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 15:07:57 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 1tMSoG-0008zO-VZ for ged-emacs-devel@m.gmane-mx.org; Sat, 14 Dec 2024 15:07:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tMSnq-0006tp-09; Sat, 14 Dec 2024 09:07:30 -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 1tMSnp-0006tU-1E for emacs-devel@gnu.org; Sat, 14 Dec 2024 09:07:29 -0500 Original-Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tMSnh-0000zp-4V; Sat, 14 Dec 2024 09:07:27 -0500 Original-Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-38632b8ae71so1995789f8f.0; Sat, 14 Dec 2024 06:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734185238; x=1734790038; 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=mYrVIPYbcYvjykBuU1TGPh7mYrrNjxxi07WiDOOE2Xo=; b=MOPBg/9HuDlMkrF9XtaQ7O/dQwI66DNKTzjLapYvLkraX7JcE2GTrR3FqWZAmKxoNN PwMt8nmEyKBnQX+uLVMcdLksf0UR8pBxy+t8mmtUKUcPabISd75f+XdsoaAe82j4geAd U/EqWLSYO2zJRHi7aL0Vwcwp5PASF6B2S8VUtFBeypoXO0+Bb66jHN80wBm/6no4pN+c zzTCx7+KtOMMNycfQt40Qm4H/vk2wAYs1592Kw2MvfA4OoYiWQJGja2dHgPGW2+QrDXf R12MglaihI/7u5fZw31l5kXr8jNHTmJWypuBoQgwudPYn/bPPAgVh7yuQbNBds9ycRQX dhnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734185238; x=1734790038; 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=mYrVIPYbcYvjykBuU1TGPh7mYrrNjxxi07WiDOOE2Xo=; b=A5PLVWc5dvmP2D9yQHOMbKI7iO2nL4uXm5wbNRwmwYzmpxxX6C38Gb4lP8xjncPshu KPEylGeBQKVfx68VH6YQiWxEI4ri2ehla6t3IyDg71cWnWRcVK6obEy1HaQkSZnN4hGr rbNvL1eIsgyAJHJIbl7FoQbFICsQjGnMowOP8UZtaDOxYtkNcjpGEUXuxaPEFROubPar ZmCFZID8vzFCNc1a2aoxAosw9myROn+vdH7EWb88HhXbpAR5n/MyMCZp02Y6ISTnC4Yi e7FrMfyOzSEa15gjHc8+2Ybq6xJPV6h6JKe6y+wtPWoCQ8nCNeaYbZztpHumBs9JwxQa f/Bw== X-Forwarded-Encrypted: i=1; AJvYcCVm3f6sgBM6T/z8Eity3zZlddxz+nUk5yGEkBNyrgA5N6QAVJHJcwRovlYoR3gcBLblTOlyGveNVJyGKA==@gnu.org X-Gm-Message-State: AOJu0YxsxcYWD7CZbMpKjUxnk++FTLeTeuJY803E5fhpO+FddIRRbCB6 sYAXFgxsjEwiOHs37krS1PON6vdgJC00n976eEk0efbiOud4emVUv+hlbqC/Auu9ZKcm2QhhfUv UEGHqYxhMXQrRxBFKB06xieFnOeh/ig== X-Gm-Gg: ASbGncvuCxr1/6s/yGDeYVjFpie+tUvBbMQsONjrwSBgzO8F9noNKbQ8HfJHsKNEIDW pINJpoE+AhJdS+USWn7Ki/Q9+zWZ8o7Hq0I94W8I= X-Google-Smtp-Source: AGHT+IGU0J39p6CJTZcWfCwE56PtRDha30kJaMC017Qcp8gLDkd+q2UjiOafTT1h2fKVjRKA9JMmIbutxOix1Br4k3Y= X-Received: by 2002:a05:6000:1449:b0:386:4034:f9a4 with SMTP id ffacd0b85a97d-3888e0b9f9cmr4807748f8f.43.1734185237471; Sat, 14 Dec 2024 06:07:17 -0800 (PST) In-Reply-To: <868qsiv3xv.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=nicolas.despres@gmail.com; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:326487 Archived-At: --0000000000000dec0106293b778c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Dec 14, 2024 at 1:34=E2=80=AFPM Eli Zaretskii wrote: > > From: Nicolas Despr=C3=A8s > > Date: Sat, 14 Dec 2024 12:45:26 +0100 > > Cc: martin rudalics , emacs-devel@gnu.org > > > > On Sat, Dec 14, 2024 at 12:30=E2=80=AFPM Eli Zaretskii w= rote: > > > > > From: Nicolas Despr=C3=A8s > > > Date: Sat, 14 Dec 2024 11:05:30 +0100 > > > > [...] > > > > > > Typical scenario: Emacs is in fullscreen; one buffer is open in a > window > > > covering the entire frame. Another buffer is opened in a second > > > window (C-x 4 f). In this case, the split should generally be > horizontal. > > > The attached patch changes `split-window-sensibly' to just try > > > spliting the longest edge first. It works well when implemented in m= y > init.el > > > and installed by setting `split-window-preferred-function'. > > > > Why don't the user options split-height-threshold and > > split-width-threshold we already have are not enough to allow to have > > this without any code changes? > > > > 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. 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. 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. Cheers, -Nico --=20 Nicolas Despr=C3=A8s --0000000000000dec0106293b778c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, Dec 14, 2024 at 1:34= =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 12:45:26 +0100
> Cc: martin rudalics <rudalics@gmx.at>, emacs-devel@gnu.org
>
> On Sat, Dec 14, 2024 at 12:30=E2=80=AFPM Eli Zaretskii <eliz@gnu.org> wrote:
>
>=C2=A0 > From: Nicolas Despr=C3=A8s <nicolas.despres@gmail.com>
>=C2=A0 > Date: Sat, 14 Dec 2024 11:05:30 +0100
>=C2=A0 >
[...]
>=C2=A0 >
>=C2=A0 > Typical scenario: Emacs is in fullscreen; one buffer is ope= n in a window
>=C2=A0 > covering the entire frame.=C2=A0 Another buffer is opened i= n a second
>=C2=A0 > window (C-x 4 f). In this case, the split should generally = be horizontal.
>=C2=A0 > The attached patch changes `split-window-sensibly' to j= ust try
>=C2=A0 > spliting the longest edge first. It works well when impleme= nted in my init.el
>=C2=A0 > and installed by setting `split-window-preferred-function&#= 39;.
>
>=C2=A0 Why don't the user options split-height-threshold and
>=C2=A0 split-width-threshold we already have are not enough to allow to= have
>=C2=A0 this without any code changes?
>
> Because these variables define the minimum size to allow splitting, no= t 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?=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.

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 f= irst fail to split vertically.

The default threshold values are fine. I just want the default b= ehavior 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 th= ere is more room.

Che= ers,
-Nico
<= /div>




--
Nicolas Despr=C3=A8= s
--0000000000000dec0106293b778c--