Search code examples
pythonemacsemacs24python-mode

python-mode.el not allowing indentation after if statement


I've searched all about, and all I could find was this similar isssue: improper exiting from indentation in emacs python-mode where someone is unable to exit from the proper indentation.

Whenever I create an if statement, say

if(foo):
    bar()

Python-mode refuses to allow me to indent the bar line, forcing me to leave it as

if(foo):
bar()

Which will throw an indentation error. This happens in all .py files. It works fine while using python.el, but I much prefer the features of python-mode. Has anyone else found a solution / run into this?

My .emacs file is only the lines for loading python-mode.


Solution

  • It's a bug. Thanks reporting.

    https://bugs.launchpad.net/python-mode/+bug/1191133

    This is fixed in trunk now. See revision 1266 at

    https://launchpad.net/python-mode

    Should also appear also at

    https://github.com/emacsmirror/python-mode

    Andreas