Comment 19 for bug 1018996

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1018996] Re: inconvenient window splitting behavior

Am 21.12.2012 18:45, schrieb Yaroslav Halchenko:
> On Thu, 20 Dec 2012, Andreas Roehler wrote:
>>> If splitting and switching are both off emacs should not change my
>>> window layout in anyway, if the buffer with the results is hidden, that
>>> is my problem.
>> okay, that's reasonable.
> good
>
>
>> I would like if there was a toggle that was basically
>>> 'leave-my-windows-exactly-as-they-were' that will turn off all of the
>>> window management (if you think this is a reasonable idea, I will try to
>>> write it).
>> Great. So I'm looking forward for your patch.
>> BTW would welcome a new report for this, not to mix up several different scenarios, but that's up to you.
>
> yikes -- why 1 more switch??? as you guys discussed, when both flags are
> off (i.e. no splitting, no focusing) -- it should already behave as
> 'leave-my-windows-exactly-as-they-were'
>

okay for me

> imho (and I think I described it before) it should be:
>
> # sorry for py-seudo code -- I have little clue in elisp
> if py-switch-buffers-on-execute-p:
> if *Python* buffer is visible:
> switch focus to it (no additional splitting, blinking, etc)
> else:
> if py-split-windows-on-execute-p:
> split code buffer and switch to the shell split
> else:
> do not split -- just bring *Python* buffer up inplace of
> current code buffer
> else:
> if py-split-windows-on-execute-p:
> if *Python* buffer is visible already:
> # DO NOTHING
> else:
> split current buffer, show *Python* in the 2nd split
> else:
> # DO NOTHING
>

Maybe have a look into py-shell-manage-windows which proceeds pretty close to your proposal.
The difference results from the flags overriding the default.