I’m having a small problem using ipython as my python interpreter with python-mode.el. everything functionally works, but pressing RET jumps ahead two lines (whether I’ve entered an expression or not) and the auto-indent for function definitions is strange. This is what it looks like:
In [164]: a = 1
In [165]:
In [166]: a + 3
Out[166]: 4
In [167]:
In [168]: def nine():
.....: .....: return 4+5
.....:
In [169]:
In [170]:
There should only be one …..: on the ‘return’ line. I suspect some indent/newline function in ipython.el or python-mode.el is being called twice somehow. (I don’t really know elisp but this may be the issue that gets me into it).
When I do ‘M-x ansi-term RET ipython’ it works as expected, but this is not ideal because sending code from other files, debugging, etc. don’t work.
I can imagine two ways to fix this: either figure out how my setup is causing the double indents/newlines and fix that, or somehow change the default python interpreter from ipython.el to ipython in ansi-term while still preserving the ability to send code and debug.
Any advice on where to start with these is appreciated.
You could check your binding for RET in a Python buffer (M-x describe-bindings) and then go from there. For me it is bound to newline. Click on the bound function or use M-x describe-function to look for the definition of the bound function.