I am trying to use aggressive-indent, which I find great, but when I am writing Python code it doesn't seem to work (although general it works fine). I may miss something in the usage of aggressive-indent, making this my fault, but I can't see why. Can someone see what is the problem?

1 Answer 1


Aggressive-indent intentionally disables itself on major modes where it wouldn't make sense. python-mode is one of them.

The problem is that indentation is not absolute in python, so Emacs has no way of performing it automatically.

You can disable this safeguard (at your own risk) with:

(setq aggressive-indent-excluded-modes
      (remove 'python-mode aggressive-indent-excluded-modes)) 
  • I thought that this was my fault. Thank you!
    – Adam
    Commented Nov 19, 2014 at 2:31
  • That option does not show up. I am on emacs 23.1.1 on rhel: is that version too old? Commented Mar 21, 2015 at 23:18
  • @javadba Yes, aggressive-indent requires Emacs 24.
    – Malabarba
    Commented Mar 21, 2015 at 23:24
  • Is there any adverse effects in using aggressive-indent in latex-mode?. Commented Dec 14, 2017 at 6:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.