Py-choose-shell is overriding `ipython' option with shebang
Bug #921990 reported by
yagnesh
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-mode.el |
Fix Released
|
Medium
|
Andreas Roehler |
Bug Description
lets say I have this in my .emacs
-------
(require 'python-mode)
(add-hook 'python-mode-hook
(lambda ()
(setq py-shell-name "ipython")))
-------
now I open a file with shebang containing
#!/usr/bin/env python3
and press C-c C-c it takes me to a python3 shell instead of ipython.
to make sure I verified with emacs -q and results the same.
What I expected is from
~ C-c C-c ~ to take me to *ipython* shell and inform
about my code is actually python3
Changed in python-mode: | |
milestone: | none → 6.0.5 |
assignee: | nobody → Andreas Roehler (a-roehler) |
importance: | Undecided → Medium |
Changed in python-mode: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
thank, Yagnesh,
pasting below from /code.launchpad .net/~yagnesh/ python- mode/py- shell et al
https:/
> So you mean to say py-shell-name has no business in calling shell and its only for come as 'default' if all others fail?
Basically.
Having multiple choices, you can't avoid some hierarchical order making
a selection.
if hard-coded `py-shell-name' always should prevail, you must it change
when executing code designed for a different Python by shebang.
The assumtion so far: shebang knows best which Python to use. Therefor
preceding by default.
Will consider possible change of py-execute-region permitting to enforce with-this- shell-instead- of-shebang" ,
a shell independent from shebang, accepting an optional argument "execute-
would replace "&optional async"