[IPython-user] autoindentation problem in emacs

Alexander Schmolck a.schmolck at gmx.net
Sat Mar 25 17:55:11 CST 2006

Fernando Perez <Fernando.Perez at colorado.edu> writes:

> Sorry not to have a solution, but if an enterprising elisp coder knows how to 
> fix this, patches are welcome.

Firstly -- the spaces or tabs are still printed by ipython even when running
in a dumb emacs terminal?

I had a brief look, but I suspect it might be tricky, because I'm not sure how
well this behaviour works with comint's idea of what a prompt is. The
additional whitespace both belongs to the prompt (because the cursor should
come after it in the new line) and doesn't (because you can delete it to
dedent back to scratch; comint normally prevents deleting into the prompt).

The easiest fix might be to disable autoindent in ipython and override the
behaviour of the return key to indedent by a tab if the line ends with a colon
and to repeat the current indentation of the previous line, but that's not
entirely pleasing.


More information about the IPython-user mailing list