5
votes

I have a few scripts that use the function pop-to-buffer a lot. It used to split the window horizontally, but now in Emacs 23 it splits the window vertically. I've dug through some of the elisp code but it's not jumping out at me - how can I change this behavior of Emacs 23 to split horizontally again?

1
Same answer as this question: stackoverflow.com/questions/966191/…scottfrazer
So true. I've had trouble with SO's automatic finding of questions/answers. I think I first learned of this from the answer you linked. +1 to that answer.Trey Jackson

1 Answers

14
votes

It's listed in the NEWS for Emacs (C-h N):

*** 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.

I think what you want is:

(setq split-width-threshold nil)

(but I think you're using the vertical versus horizontal splitting the opposite of what Emacs terminology is (which is counterintuitive to me as well))