py-split-windows-on-execute-p is broken. Its outcome depends unpredictably on the python shell

Bug #1361531 reported by Zeitlinie
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
High
Andreas Roehler

Bug Description

According to the documentation py-split-windows-on-execute-p should split windows when non nil.

For me this is not true.
In fact the behavior depends on the py-shell used.

1)
*No* splitting of windows occurs with a single *.py file open, issuing the command C-c ! and using only this simple init.el (i.e. using IPython)

;; 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-default py-shell-name "ipython")
(setq-default py-python-command-args '("--pylab=qt4"))
(setq-default py-which-bufname "IPython")

(setq py-split-windows-on-execute-p t)

----------------------------

2)
In contrast to that, splitting *does* occur with a single *.py file open, issuing the command C-c ! and using only this simple init.el (i.e. using plain Python)

;; 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)

----------------------------

3)
For other shells I do not know

Changed in python-mode:
importance: Undecided → High
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.2.0
Revision history for this message
Andreas Roehler (a-roehler) wrote :

Does this still happen?

Changed in python-mode:
status: New → Fix Committed
Revision history for this message
Zeitlinie (zeitlinie) wrote :

Yes, with the most recent check-out it still happens, but I have some more info to add.

In the IPython shell case, number 1), I realized, the following:
- open a terminal alongside with emacs and issue the 'top' command in the terminal
- then use the simple init.el from number 1) and issue a 'C-c !' on a *.py test file.
  Still *no* window with an IPython buffer will open in emacs
- in the window with the top command running I see IPython rising up with some CPU
  usage and dropping down after some time
- then emacs's command line buffer will show a message: "Text is read-only"
- if *then* I issue a *second* C-c ! on the *.py file in emacs, then, immediately a
   window with an IPython buffer will open

So it seems that for IPython, one needs to issue the C-c ! command *twice* with a certain 'waiting period' in between.
This is really strange!?

Regarding point 2) nothing has changed.

Revision history for this message
Zeitlinie (zeitlinie) wrote :

Just to make sure, let me add that for me, when I ask
C-h v: py-version

I get 6.1.4

this is the version I get from "bzr branch lp:python-mode"

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1361531] Re: py-split-windows-on-execute-p is broken. Its outcome depends unpredictably on the python shell

On 27.08.2014 22:28, Zeitlinie wrote:
> Just to make sure, let me add that for me, when I ask
> C-h v: py-version
>
> I get 6.1.4
>
> this is the version I get from "bzr branch lp:python-mode"
>

That's correct. The trunk displays the version of upcoming release, i.e, version is not that meaningful,
it's about number of bzr revision rather.

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

BTW when referring to trunk, "bzr log -l 1" will display the revisions number useful here.

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

Please re-open if not done, resp. make a new report WRT remaining related issues.

Changed in python-mode:
status: In Progress → Fix Committed
Revision history for this message
Zeitlinie (zeitlinie) wrote :

I'm sorry, but for me none of the fixes committed so far change anything.

The bug remains exactly as described in the initial post: for the IPython shell still no splitting of windows occurs.

Currently I have:
C-h v py-version returns 6.1.4
bzr log -l 1 returns revno: 1678
C-h v emacs-version returns 24.3.1

Revision history for this message
Andreas Roehler (a-roehler) wrote :

On 20.09.2014 11:00, Zeitlinie wrote:
> I'm sorry, but for me none of the fixes committed so far change
> anything.
>
> The bug remains exactly as described in the initial post: for the
> IPython shell still no splitting of windows occurs.
>
> Currently I have:
> C-h v py-version returns 6.1.4
> bzr log -l 1 returns revno: 1678
> C-h v emacs-version returns 24.3.1
> .

Please check again. Will attach a png displaying the result from tests.

Changed in python-mode:
status: Fix Committed → Incomplete
Revision history for this message
Zeitlinie (zeitlinie) wrote :

Nothing has changed.
Attached please find 5 pngs, ordered according to the 1st number in their file name, which show that no py shell buffer gets 'split' off in a new window.
The last file '5 ...png' is what I would expect to happen after invocation of the default interpreter (both from C-c ! and Python menu), but this does not happen.

bzr log -l 1 returns revno: 1683

Revision history for this message
Zeitlinie (zeitlinie) wrote :

WAIT!

I should add to my previous comment #9 that it applies only to the IPython shell, and to the situation 1) of my initial post.

While in all previous comments the split window functionality *did* work for the plain Python shell, it now is broken *also* for the latter, i.e., if I go through scenario 2) of my initial post, then, after C-c ! a Python shell window does get split off, but now the window containing the initial Python file gets *exchanged* with some other buffer on the present buffer list.

So, the fix did make things even worse ;) :(

Changed in python-mode:
status: Incomplete → In Progress
Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1361531] [NEW] py-split-windows-on-execute-p is broken. Its outcome depends unpredictably on the python shell

On 26.08.2014 09:50, Zeitlinie wrote:

py-split-windows-on-execute-p renamed in trunk to

py-split-windows-on-execute

as it's not a boolean any more.

New option nil: when set, output-buffer opened manually should be reused.

HTH for the moment,

Andreas

Changed in python-mode:
milestone: 6.2.0 → 6.2.1
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.