diff options
| author | Nicolas Despres | 2024-12-21 12:45:12 +0100 |
|---|---|---|
| committer | Eli Zaretskii | 2025-02-08 10:57:07 +0200 |
| commit | 77ff0df588b6691db38be810210225e84d15eca3 (patch) | |
| tree | 04283cd2bc242bc676172ac72f449fb66c88dd94 /doc | |
| parent | 028913c446b8f06288f2e17be91aef701dc58ba4 (diff) | |
| download | emacs-77ff0df588b6691db38be810210225e84d15eca3.tar.gz emacs-77ff0df588b6691db38be810210225e84d15eca3.zip | |
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.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/emacs/windows.texi | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi index a992f26fcdd..a4941435073 100644 --- a/doc/emacs/windows.texi +++ b/doc/emacs/windows.texi | |||
| @@ -511,6 +511,7 @@ selected frame, and display the buffer in that new window. | |||
| 511 | 511 | ||
| 512 | @vindex split-height-threshold | 512 | @vindex split-height-threshold |
| 513 | @vindex split-width-threshold | 513 | @vindex split-width-threshold |
| 514 | @vindex split-window-preferred-direction | ||
| 514 | The split can be either vertical or horizontal, depending on the | 515 | The split can be either vertical or horizontal, depending on the |
| 515 | variables @code{split-height-threshold} and | 516 | variables @code{split-height-threshold} and |
| 516 | @code{split-width-threshold}. These variables should have integer | 517 | @code{split-width-threshold}. These variables should have integer |
| @@ -519,7 +520,9 @@ window's height, the split puts the new window below. Otherwise, if | |||
| 519 | @code{split-width-threshold} is smaller than the window's width, the | 520 | @code{split-width-threshold} is smaller than the window's width, the |
| 520 | split puts the new window on the right. If neither condition holds, | 521 | split puts the new window on the right. If neither condition holds, |
| 521 | Emacs tries to split so that the new window is below---but only if the | 522 | Emacs tries to split so that the new window is below---but only if the |
| 522 | window was not split before (to avoid excessive splitting). | 523 | window was not split before (to avoid excessive splitting). Whether |
| 524 | Emacs tries first to split vertically or horizontally, is | ||
| 525 | determined by the value of @code{split-window-preferred-direction}. | ||
| 523 | 526 | ||
| 524 | @item | 527 | @item |
| 525 | Otherwise, display the buffer in a window previously showing it. | 528 | Otherwise, display the buffer in a window previously showing it. |