Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent Emacs resizing my windows?

my Lisp-working-environment has the frame split into two windows, the former for the main coding, the latter for my slime evaluation.

Unfortunately, when I made some mistakes (cause I'm still learning Lisp :P) the slime debugger warns me, and doing this it shows up into the bottom window that is automatically resized. Just to be more explicit:

BEFORE:

_______
|     |
|     |
_______
|_____|

AFTER:

_______
|     | <- decreased in size!
_______
|_____| <- increased in size!

How can I prevent Emacs resizing my windows? I want Emacs to leave my window sizes the same.

How can I accomplish that?

Thanks! Bye!

Alfredo

like image 472
Alfredo Di Napoli Avatar asked Jan 17 '11 19:01

Alfredo Di Napoli


People also ask

How do I resize a window in Emacs?

Type C-c + to enlarge the window. Then hit + or - repeatedly to enlarge/shrink the window. Any other key ends the resize operation.

What is the quickest way in resizing or reducing the window?

Press Alt + Spacebar again to open the window menu, arrow down to Size, and press Enter . Press the up or down arrow key if you want to resize the window vertically or the left or right arrow key if you want to resize horizontally.

How do I close a buffer window in Emacs?

C-x 4 0 ( kill-buffer-and-window ) is a stronger command than C-x 0 ; it kills the current buffer and then deletes the selected window. C-x 1 ( delete-other-windows ) deletes all the windows, except the selected one; the selected window expands to use the whole frame.


2 Answers

You can remember your window configuration using the command M-x window-configuration-to-register (or C-x r w) at the beginning.

After you can always restore your configurations using M-x jump-to-register (or C-x r j).

like image 69
Oleg Pavliv Avatar answered Oct 22 '22 00:10

Oleg Pavliv


Unfortunately the main command pop-to-buffer, which is used by almost every program in emacs to switch to a buffer in a different window, has the side-effect you described.

In adition to all other solutions so far, there is a winner mode to undo/redo any changes in window configuration, at any moment of time.

like image 24
VitoshKa Avatar answered Oct 21 '22 22:10

VitoshKa