Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Horizontal split for pop-to-buffer in Emacs 23?

Tags:

emacs

elisp

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?

like image 840
Brad Achorn Avatar asked Sep 21 '09 17:09

Brad Achorn


1 Answers

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))

like image 193
Trey Jackson Avatar answered Sep 20 '22 12:09

Trey Jackson