Comment 33 for bug 1361535

Revision history for this message
deuscovrigus@gmail.com (deuscovrigus) wrote : Re: [Bug 1361535] Re: py-switch-buffers-on-execute-p is broken. It uses/kills other buffers.

Hey thanks for the commit, the splitting no longer occurs and windows are
re-used. However there is a bit of erratic choice when windows are picked.
As usual the setup is C-x 2 <RET> C-x 3 <RET>
When execute python from the top left window , a shell is popped on my top
right window, but the focus of my buffer switches to the next window for no
reason. I guess this wasn't intended?

Additionally, if the python buffer is present in any of the current
windows,(see init_setup_python_shell_visible.png) instead of just re-using
that window, executing python will replace an additional window. And, as
before, the buffer focus changes to the next window. (see
additional_window_is_replaced_instead_of_reusing_bottom_window.png).

Seems to me that the current implementation just picks the window obtained
by C-x o (other-window-or-frame) without checking to see whether the python
shell is in any of the windows. After that, the current buffer focus is
switched to the window obtained by C-u 2 C-x o (i.e., two windows ahead of
the window python was executed from).

Again, thanks for looking into this, and , if it's not too much to ask, can
the default placement of the chosen window for the shell be like the
widest window available?,i.e. the bottom window of my 3-window setup (this
would mimic a console-like environment which I'm sure users will like)

-Octi

On Fri, Jul 24, 2015 at 2:48 AM, Andreas Roehler <email address hidden>
wrote:

> Please re-open if not done.
>
> ** Changed in: python-mode
> Status: New => Fix Committed
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1472620).
> https://bugs.launchpad.net/bugs/1361535
>
> Title:
> py-switch-buffers-on-execute-p is broken. It uses/kills other buffers.
>
> Status in python-mode.el:
> Fix Committed
>
> Bug description:
> According to documentation, when non-nil py-switch-buffers-on-
> execute-p should switch to the Python output buffer.
>
> In practice the switching does *not* occur into the Python output
> buffer already open, but into any *other* buffer currently opened.
> This implies, that with several windows on the emacs pane opened each
> C-c | command issued will 'eat up' one more window and exchange its
> buffers content with the Python shell until emacs's pane is completely
> fill with many Python shells and a single Python code buffer.
>
> This behavior can be reproduced with the following simple init.el file
>
> ;; load path of most recent python-mode.el from bzr branch lp:python-mode
> (add-to-list 'load-path "~/temporary/py/python-mode/")
>
> (require 'python-mode)
> (add-to-list 'auto-mode-alist '("\\.py$" . python-mode))
>
> (setq py-split-windows-on-execute-p t)
> (setq py-switch-buffers-on-execute-p t)
>
> Once the situation has been reached that emacs's pane is filled with
> many Python shells and a single Python code buffer, issuing the
> command C-c | still leads to a permanent interchange of buffers with
> the Python code file 'wandering' around on emacs's pane.
>
> In the simplest case with only one Python shell and one code buffer
> displayed, there will be a permanent exchange of the buffers location
> on the screen will issuing the command C-c |
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/python-mode/+bug/1361535/+subscriptions
>