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?


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
    Nov 19 '14 at 2:31
  • That option does not show up. I am on emacs 23.1.1 on rhel: is that version too old? Mar 21 '15 at 23:18
  • @javadba Yes, aggressive-indent requires Emacs 24.
    – Malabarba
    Mar 21 '15 at 23:24
  • Is there any adverse effects in using aggressive-indent in latex-mode?.
    – 46_and_2
    Dec 14 '17 at 6:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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