[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Windows splitting: prefer only 2 windows horizontal spliting.
From: |
martin rudalics |
Subject: |
Re: Windows splitting: prefer only 2 windows horizontal spliting. |
Date: |
Mon, 21 Feb 2011 08:46:53 +0100 |
User-agent: |
Thunderbird 2.0.0.21 (Windows/20090302) |
> How prefer horizontal splitting I know:
>
>
> (when window-system
> ;; Prefer horizontal windows splitting.
> (setq split-height-threshold 0)
> (setq split-width-threshold nil)
> )
This prefers "vertical" splitting in Emacs parlance ;-) But why do you
check for `window-system' and why do you set `split-height-threshold' to
zero?
> But how stop Emacs from splitting when already 2 windows?
> So reuse existing window.
Whenever you ask Emacs to display a buffer, it looks at the largest
window on your frame which, since you don't make side-by-side windows,
is the highest window on your frame. In `window-splittable-p' the
following happens:
(>= (window-height window)
(max split-height-threshold
(* 2 (max window-min-height
(if mode-line-format 2 1))))))))))
Since `split-height-threshold' is zero, a new window is split off
whenever the height of the largest window (the value of `window-height'
for that window) is at least as large as two times the minimum height of
the largest window (the value of `window-min-height').
Try setting `split-height-threshold' and `split-width-threshold' both to
nil. This should allow at most two windows on your frames.
martin