ipython emacs IndentationError

emacs, ipython

Solution

You might try toggling autoindent with

`%autoindent`

since I think that has caused the problem for me before.

You can change this permanently using ipython's customization. After the proper imports (see the link) the following should work in ipy_user_conf.py:

# Emacs sets the term to dumb so we can distinguish that way
if os.environ['TERM'] == 'dumb':
    ip.options.autoindent = 0

Problem

Really annoying problem in ipython prompt in emacs: ``` In [128]: if 1==1: .....: print "yes" .....: else: .....: print "no" .....: IndentationError: unindent does not match any outer indentation level ``` It looks perfectly aligned to me, not sure what trigger the error. No such problem when I do this in terminal.

Original source