Emacs: split window size in python-mode

1k views Asked by At

I set split-width-threshold to nil, so on execution the python shell will appear in a split window below. However, the shell always occupies half of the frame. Is it possible to adjust the size (automatically on execution)?

The py-split-windows-on-execute-function seems to only accept two options (split-window-vertically and split-window-horizontally).

Emacs version: 24.3

1

There are 1 answers

0
Andreas Röhler On BEST ANSWER

Thanks, IMO that's a reasonable request. It's here now:

https://bugs.launchpad.net/python-mode/+bug/1266169

After further reflection, the following result: Shrinking the output-buffer only has effect for a very limited number of events. Afterward the buffer is filled and window-size is half-way like the current default.

From this don't see it's justified to hard-code it.

Also there is a solution, which seems to come nearby the desired behavior:

  M-x python RET

switch to py-shell resp. output-buffer and

M-x shrink-window-if-larger-than-buffer RET, it's on C-x -

Than M-x customize-variable RET py-keep-windows-configuration RET

to `t' or 'force

The following run should keep the window small, resp. enlarged.

To make customization easier, extended the menu: Python/Customize/Switches/Display/py-keep-windows-configuration