py-shell-manage-windows works poorly under horizontal window splitting

Bug #1273902 reported by J D
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
High
Andreas Roehler

Bug Description

in py-shell-manage windows, the following bit of code executes if there's an exception:

        ((and (boundp 'err-p) err-p)
          (message "hello")
         (py-restore-window-configuration)
         (py-jump-to-exception err-p py-exception-buffer)
         ;; (goto-char (point-max))
         (and (window-full-height-p)
              (funcall py-split-windows-on-execute-function))

This works as expected if windows are split vertically - if the window is already split, the window size is not full-height, and the split window function is not called. However, if the windows are split horizontally, this will continually call the py-split-windows-on-execute-function command every time the file is run, instead of re-using the same window for exceptions. Furthermore, it doesn't respect the py-split-windows-on-execute-p setting.

a proposed fix would be to check the current value of py-split-windows-on-execute-function, and use either window width or window height as appropriate.

Changed in python-mode:
importance: Undecided → High
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.1.4
Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1273902] [NEW] py-shell-manage-windows works poorly under horizontal window splitting

Am 29.01.2014 02:01, schrieb J D:
> Public bug reported:
>
> in py-shell-manage windows, the following bit of code executes if
> there's an exception:
>
> ((and (boundp 'err-p) err-p)
> (message "hello")
> (py-restore-window-configuration)
> (py-jump-to-exception err-p py-exception-buffer)
> ;; (goto-char (point-max))
> (and (window-full-height-p)
> (funcall py-split-windows-on-execute-function))
>
> This works as expected if windows are split vertically - if the window
> is already split, the window size is not full-height, and the split
> window function is not called. However, if the windows are split
> horizontally, this will continually call the py-split-windows-on-
> execute-function command every time the file is run, instead of re-using
> the same window for exceptions.

  (one-window-p t) at this plase should do the trick.
Will check a fix.

   Furthermore, it doesn't respect the py-
> split-windows-on-execute-p setting.

This is an error-display, so this setting will be ignored anyway here.

>
> a proposed fix would be to check the current value of py-split-windows-
> on-execute-function, and use either window width or window height as
> appropriate.
>
> ** Affects: python-mode
> Importance: Undecided
> Status: New
>

Changed in python-mode:
status: New → In Progress
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Checked in a fix. Please tell if it works for you.

Revision history for this message
J D (james-davidheiser) wrote :

This fix worked for me - thanks!

Changed in python-mode:
status: In Progress → Fix Committed
Changed in python-mode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.