From: "Nicolas Desprès" <nicolas.despres@gmail.com>
To: Juri Linkov <juri@linkov.net>
Cc: emacs-devel@gnu.org
Subject: Re: Prefer to split along the longest edge
Date: Sat, 14 Dec 2024 21:10:38 +0100 [thread overview]
Message-ID: <CAPqtr1+NuQv7p3feoUSJiWhjKwbG3YbXPBEcfGg19XTE_a2BMQ@mail.gmail.com> (raw)
In-Reply-To: <87r06a3yfg.fsf@mail.linkov.net>
[-- Attachment #1: Type: text/plain, Size: 2035 bytes --]
On Sat, Dec 14, 2024 at 7:38 PM Juri Linkov <juri@linkov.net> wrote:
> > Currently, `split-window-sensibly' prefers to split vertically,
> > disregarding the shape of the frame. This is a good default when
> > Emacs is taller than wider. However, when Emacs is in fullscreen
> > (landscape screen layout), splitting vertically is generally not the
> > thing to do because there is plenty of space on the right.
> >
> > 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.
>
> I see no symmetry between width and height.
>
> To make a window usable you need to decide how many columns you need
> to fit into the window by customizing split-width-threshold.
>
> By default it's 160 that means two horizontally split windows
> with 80 columns in each that allows a comfortable use of each window.
>
> OTOH, the window height has less relevance since most of the time
> all windows are scrolled vertically.
>
Thanks for your reply.
My proposal is not about questioning the relevance of the
split-width-threshold and split-height-threshold. They are perfectly fine
to me.
I don't want to scroll twice more because of a vertical split, whereas I
have the 2/3 of my screen free to show another buffer of code.
In this scenario both splits would succeed because the frame dimension
exceeds by a lot their respective threshold.
My point is about the order in which splits are tried. I would like it to
first tries the longest edge.
So that if it succeed it is likely to be the direction where there is the
more space available.
But I understand the bias toward vertical splitting, that's why I added a
condition to prioritize vertical split if the width is less than 80. This
heuristic could be improved, thought.
[-- Attachment #2: Type: text/html, Size: 3206 bytes --]
next prev parent reply other threads:[~2024-12-14 20:10 UTC|newest]
Thread overview: 59+ 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
2024-12-14 17:16 ` martin rudalics
2024-12-14 17:33 ` Eli Zaretskii
2024-12-14 17:36 ` Eli Zaretskii
2024-12-14 18:35 ` Juri Linkov
2024-12-14 20:10 ` Nicolas Desprès [this message]
2024-12-15 7:34 ` Juri Linkov
2024-12-15 9:29 ` Nicolas Desprès
2024-12-16 7:55 ` Juri Linkov
2024-12-16 11:56 ` Nicolas Desprès
2024-12-16 17:14 ` Eli Zaretskii
2024-12-16 17:44 ` Juri Linkov
2024-12-16 19:07 ` Eli Zaretskii
2024-12-16 19:14 ` Juri Linkov
2024-12-16 19:53 ` Eli Zaretskii
2024-12-17 6:12 ` Nicolas Desprès
2024-12-17 7:40 ` Juri Linkov
2024-12-17 8:35 ` Nicolas Desprès
2024-12-17 9:02 ` martin rudalics
2024-12-17 9:09 ` Nicolas Desprès
2024-12-17 13:34 ` Eli Zaretskii
2024-12-18 10:05 ` martin rudalics
2024-12-18 14:12 ` Eli Zaretskii
2024-12-18 16:24 ` martin rudalics
2024-12-18 16:55 ` Eli Zaretskii
2024-12-18 17:41 ` martin rudalics
2024-12-18 18:41 ` Eli Zaretskii
2024-12-18 19:13 ` martin rudalics
2024-12-19 7:06 ` Juri Linkov
2024-12-18 17:25 ` Juri Linkov
2024-12-17 6:06 ` Nicolas Desprès
2024-12-17 12:52 ` Eli Zaretskii
2024-12-17 12:59 ` Eli Zaretskii
2024-12-17 13:12 ` Robert Pluim
2024-12-18 21:08 ` Nicolas Desprès
2024-12-19 6:39 ` Eli Zaretskii
2024-12-19 8:52 ` martin rudalics
2024-12-19 9:21 ` Eli Zaretskii
2024-12-19 16:20 ` Nicolas Desprès
2024-12-20 9:03 ` martin rudalics
2024-12-20 14:43 ` Nicolas Desprès
2024-12-20 15:05 ` Robert Pluim
2024-12-20 20:25 ` Stephen Berman
2024-12-21 11:54 ` Nicolas Desprès
2024-12-16 17:32 ` Juri Linkov
2024-12-17 9:01 ` martin rudalics
2024-12-17 13:32 ` Eli Zaretskii
2024-12-17 1:51 ` Liu Hui
2024-12-17 7:43 ` Juri Linkov
2024-12-17 8:27 ` Nicolas Desprès
2024-12-17 8:26 ` Nicolas Desprès
2024-12-16 17:15 ` [External] : " Drew Adams
2024-12-17 8:39 ` Nicolas Desprès
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPqtr1+NuQv7p3feoUSJiWhjKwbG3YbXPBEcfGg19XTE_a2BMQ@mail.gmail.com \
--to=nicolas.despres@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=juri@linkov.net \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.