Indentation is crazy in Emacs Haskell mode

After a recent full featured update, I noticed that the indentation in Haskell mode got really weird:

import Data.Ratio
    _

      

The underline means the position of the caret after being pressed Enter, that is, in my case in column 4. This is really unbearable because it is sent to column 4 every time I click Enter.

I'm sure this has nothing to do with Haskell mode itself, as it has no recent updates and has worked great so far. However, there seems to be a newer version of Emacs: 24.4 , so I'm wondering if they've changed anything that might cause this error.

Anyone else running into the problem? Do you have any ideas how to fix this?

+3


source to share


1 answer


There seems to be a new indentation mode introduced with 24.4 (see "Editing Changes ... Indent" here ) electric-indent-mode

You can disable (for session)

M-x electric-indent-mode

      

or by adding something like



(electric-indent-mode 0)

      

to your .emacs

file.

You can only disable it on haskell-mode

too with this:

(add-hook 'haskell-mode-hook
          (lambda () (electric-indent-local-mode 0)))

      

+3


source







All Articles