4

I am not sure what to search for. I have used emacs for 25+ years, but I am not a guru. I use it as a tool, and I don't want to spend much time changing it.

I generally like to have one window, or two windows that are each half height. I don't like it when some command or mode changes the height of one of the windows to more or less than half.

For example, when I'm in a shell buffer and use tab completion, the buffer with completion options changes the window sizes, and I have to manually restore them to a 50-50 split.

I seem to remember fixing this in the past, but I don't remember how. I don't know what command or mode is doing this now, but seems to be very often since the last major release. Can someone fix this or tell me how?

Sorry if my tone is not pleasant. This is pissing me off much more than it should.

10
  • 2
    Not enough information. Too vague.
    – Drew
    Commented Nov 28, 2016 at 22:19
  • 1
    Please explain a little more what you want to have happen. Are you looking to never open more windows, or ways to manage multiple windows easier, or something else?
    – zck
    Commented Nov 28, 2016 at 22:28
  • 4
    C-x + will rebalance your windows. 'some common thing' is a bit vague. It would be much easier to help you if you could tell us which common thing you are referring to.
    – Tyler
    Commented Nov 28, 2016 at 23:18
  • 5
    reported: debbugs.gnu.org/cgi/bugreport.cgi?bug=25055
    – Tyler
    Commented Nov 29, 2016 at 1:13
  • 1
    @Drew This has actually been bothering me for a while, but I had been too lazy to track it down. So thanks, nroose, I will be looking forward to having this fixed, whenever that might happen!
    – Tyler
    Commented Nov 29, 2016 at 2:56

1 Answer 1

5

This appears to be a change in the way completion windows are created/removed. You can avoid it by setting window-combination-resize to t:

(setq window-combination-resize t)

The current default behaviour for completion buffers is to take all of the space needed from a single window. If this isn't enough to show all the completions, the window is enlarged to fit. Then, when the completion buffer is dismissed, the original buffer is restored, but the window size is left in its new, enlarged state.

Setting window-combination-resize to t changes this behaviour. Instead of the new window getting all of its space from a single original window, it takes space proportionally from all the windows in the frame. And when the window is destroyed, its space is redistributed among the remaining windows. As a consequence, completion buffers 'steal' space from all windows when they are created, and return this stolen space to all windows when they are destroyed.

This setting will also have other effects on your window management. Most notably, when you split a frame twice in a row in one direction (i.e., C-x 2 C-x 2 or C-x 3 C-x 3, you'll get three equal sized windows, instead of one half-size window and two quarter-size windows.

As mentioned in the comments, I reported the original behaviour as a bug. This was acknowledged as an undesirable state, but from the response it sounds like fixing it is not a trivial task.

1
  • Thank you for your answer! This does help a lot! Just FYI, my experience before changing that setting was that the window it took the space from was being reduced in size itself, and then not restored...
    – nroose
    Commented Nov 29, 2016 at 19:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.