3

After building a two column, 3 window layout with one tall column and two stacked equal sized shorter columns next to it, when I run commands like magit or ag that bring up a new buffer, often one of the shorter windows is resized so that it almost fills that column, and this leaves the other shorter window with just a hand full of lines left.

How can I always prevent emacs from resizing my windows after I've set them up? I've heard of winner mode, but it's less than ideal because 1) undoing the resize has the unfortunate side effect of also obscuring the buffer that I wanted to work with in the first place that triggered the resizing (ag or magit in my case), and 2) I would prefer emacs not to automatically resize frames in the first place.

Is there some configuration options that I can use to prevent emacs from ever resizing any of my windows, no matter what buffers it's trying to display?l

1

Try the folowing after the windows are set up:

(setq-default window-size-fixed t)

The variable is buffer-local.

  • The problem is this is buffer-local, so I'd have to set it for every buffer I ever open. If I switch to a buffer without this variable set and do another ag search, then the windows get resized again. There has to be a way to prevent windows from resizing when new buffers get displayed. – 732 Dec 25 '17 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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