What does it take to replace regular /usr/bin/python with a custom python shell in Emacs’ python-mode?
Basically I have a binary /usr/bin/mypython which does some initializations before starting python interpreter prompt, and for all interaction purposes, the resulting interpreter shell is equivalent to /usr/bin/python.
However, if I specify this binary in “python-python-command” (using python.el in Emacs 23.3), I get “Only Python versions >=2.2 and < 3.0 are supported”
I’m about to read the elisp to check, but I’d bet if you added a
--versionflag that gave the save results as/usr/bin/python, emacs would be happy.Update
Here’s the code in python.el line 1555 et seq in EMACS 23.3.1:
What it’s doing is running a one-liner
that just prints “True” or “False”. Fix your script to handle the -c flag and you should be fine.
Alternatively, you could take the hacker’s way out and force the value of
python-version-checkedtot, and it’ll never do the check.