From: "Nicolas Desprès" <nicolas.despres@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rudalics@gmx.at, emacs-devel@gnu.org
Subject: Re: Prefer to split along the longest edge
Date: Sat, 14 Dec 2024 16:41:30 +0100 [thread overview]
Message-ID: <CAPqtr1LxF=goDG8PLaE80BTPASve4EQ6gjqyNQoPCo1jYztbug@mail.gmail.com> (raw)
In-Reply-To: <86msgytiue.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2010 bytes --]
On Sat, Dec 14, 2024 at 3:55 PM Eli Zaretskii <eliz@gnu.org> wrote:
> > From: Nicolas Desprès <nicolas.despres@gmail.com>
> > 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.
[-- Attachment #2: Type: text/html, Size: 3375 bytes --]
next prev parent reply other threads:[~2024-12-14 15:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-14 10:05 Prefer to split along the longest edge Nicolas Desprès
2024-12-14 11:30 ` Eli Zaretskii
2024-12-14 11:45 ` Nicolas Desprès
2024-12-14 12:34 ` Eli Zaretskii
2024-12-14 14:06 ` Nicolas Desprès
2024-12-14 14:55 ` Eli Zaretskii
2024-12-14 15:41 ` Nicolas Desprès [this message]
2024-12-14 17:16 ` martin rudalics
2024-12-14 17:33 ` Eli Zaretskii
2024-12-14 17:36 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPqtr1LxF=goDG8PLaE80BTPASve4EQ6gjqyNQoPCo1jYztbug@mail.gmail.com' \
--to=nicolas.despres@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=rudalics@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).