Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've recently upgraded Emacs from v22 to v23 in Ubuntu Jaunty 9.04. Prior to the upgrade when I issued the switch-to-buffer-other-window command (either via C-x 4 b or M-x switch-to-buffer-other-window) the new window was below the existing window, however after upgrading it started to split the window horizontally, resulting in the two windows side by side.

I've googled and searched through the customize menu item, but couldn't find any reference or solution, could you please tell me how can I change this setting? Thank you very much.

share|improve this question
up vote 3 down vote accepted

From the NEWS (C-h n) section:

*** display-buffer' tries to be smarter when splitting windows. The new option split-window-preferred-function' lets you specify your own function to pop up new windows. Its default value split-window-sensibly' can split a window either vertically or horizontally, whichever seems more suitable in the current configuration. You can tune the behavior of split-window-sensibly by customizing split-height-threshold' and the new option `split-width-threshold'. Both options now take the value nil to inhibit splitting in one direction. Setting split-width-threshold to nil inhibits horizontal splitting and gets you the behavior of Emacs 22 in this respect. In any case, display-buffer may now split the largest window vertically even when it is not as wide as the containing frame.

So, the solution is:

(setq split-width-threshold nil)
share|improve this answer
Thank you very much, Trey. I still wonder why they did it this way, but I am completely newbie to Emacs, so it's not the right time yet to complain ;) – Leandro López Oct 15 '09 at 13:10
The new settings allow more flexibility, which can be very useful given the propensity for developers to have dual monitors (and thus very wide Emacsen). If your window is 2 screens wide, it makes sense to split it into two with a vertical separator... – Trey Jackson Oct 21 '09 at 20:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .