]> git.eshelyaron.com Git - emacs.git/commit
Prioritize split along the longest edge by default.
authorNicolas Despres <nicolas.despres@gmail.com>
Sat, 21 Dec 2024 11:45:12 +0000 (12:45 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 9 Feb 2025 08:45:05 +0000 (09:45 +0100)
commita409a5316d0b8acc257029fcba08ed4568af14bf
treeda55b537a4cc8649e8992d71c7da74fe70c10faa
parenta8b5ff4df039612aa94565ee6c530d8336917eec
Prioritize split along the longest edge by default.

Currently, `split-window-sensibly' prefers to try to split
vertically first, disregarding the actual shape of the frame
or the user preferences.  This is a good default when Emacs
is taller than wider.  However, when Emacs is in full-screen
(landscape screen layout), trying to split vertically may not
be what the user expected, since there is plenty of space
available on the right.

Typical scenario: Emacs is in landscape layout, one buffer is
open in a window covering the entire frame.  Another buffer is
opened in a second window (C-x 4 f). Both splits are feasible
but users may prefer the horizontal one.

This patch preserves the behavior of the `split-height-threshold'
and `split-width-threshold' variables.  Splitting continues not
to be permitted if the edge length is below the threshold.

* lisp/window.el (split-window-sensibly): First tried split
direction follows user preferences.

* etc/NEWS: Add an entry for new variable
`split-window-preferred-direction'.
* doc/emacs/windows.texi: Document new variable.

(cherry picked from commit 77ff0df588b6691db38be810210225e84d15eca3)
doc/emacs/windows.texi
lisp/window.el