Search code examples
emacsindentationsml

Funky indentation in SML mode


I installed SML Mode in Emacs and the indentation is messed up. I disabled all my .emacs customizations, but that didn't make any difference. At the end of each line in the code below, I used C-j, which is mapped to newline-and-indent.

pow

dist

If I highlight everything and reindent (C-M-\), the result makes more sense:

pow-improved dist-improved

I'm using Emacs 24.1.1 and SML Mode 6.2 on Ubuntu 12.10. What should I do?


Solution

  • Don't use newline-and-indent. You can use reindent-then-new-and-indent or electric-indent-mode instead.