~tcaswell-gmail/python-mode/window_fix

Viewing all changes in revision 1165.

  • Committer: Thomas Caswell
  • Date: 2012-12-22 21:06:14 UTC
  • Revision ID: tcaswell@gmail.com-20121222210614-789f0ao82a4eilcb
- Re-wrote py-shell-manage-windows
- added helper function
- added custom switch py-on-execute-buffer-management-p
- removed (delete-other-windows) from code

I interpret the new switch as meaning 'try to make sure that the output buffer is visible after the code runs' ( py-on-execute-buffer-management-p )

If buffer management is disabled then everything else is ignored and emacs will not change anything about your buffers/windows.

If buffer management is enabled, then I interpret the switch flag as meaning 'make sure the current buffer/window after execution is the output buffer' and the split flag as 'if needed, emacs may create a new window by splitting the code buffer using the specified method'

This leads to the following logic

I) If there is only one window and splitting is disabled, then
    If switching is on, then we need to set the buffer in that window to the output buffer.
    If switching is off, nothing should change. (this is the one branch where emacs fails to make the output buffer visible)

II) if splitting is enabled and output buffer is not visible
IIa) if the number of windows is less than the maximum
  we split the code window, put the output in the new window, jump to III)
IIb) if the number of windows is not less than the maximum
  we select the least recently used window and set it to display the output buffer

III) if output buffer is visible
    we switch to it depending on if switching is enabled

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: