tags:

views:

101

answers:

2

I often have split windows in a frame where one is much smaller than the other (usually done through C-u C-u C-x ^). This is so I can see some snippet of code as reference while doing something else.

The problem is: when I use C-x 4 b to switch to some other buffer (or C-x 4 f to open a new file in the lower window), the lower window is resized to its original half-the-frame height size. Is there a way to stop that from happening and keep my smaller window size?

A: 

C-x 4 b isn't really a nav command. Do you still have the problem if you C-x b or simply C-x o?

Paul McMillan
It's the navigating that's the problem. C-x b and C-x o work fine. It's when I want to show another buffer (or open another file) in the lower window that things get resized. Edited the question to try to make that clearer.
Cristian
+3  A: 

If you evaluate (setq even-window-heights nil) before running C-x 4 f (or a similar command), Emacs won't try to balance the heights of your windows. Here's the documentation for even-window-heights:

If non-nil display-buffer will try to even window heights.
Otherwise display-buffer will leave the window configuration
alone. Heights are evened only when display-buffer chooses a
window that appears above or below the selected window.

I recommend writing a small elisp function that sets this variable to nil and then calls switch-to-buffer-other-window or find-file-other-window, since it's probably something that you'll want to do frequently.

Emerick Rogul