Please help me set up proper indentation in Emacs haskell-mode
When I'm trying to type down something like ADT or a record, I'm getting on the wrong column after pressing <ENTER>
, and pressing <TAB>
won't switch to the right one until I enter either |
or ';'!
data MyADT = Oh | Hi | Hello | <- the cursor is here again!
Trying to solve the problem I set
(define-key global-map (kbd "RET") 'reindent-then-newline-and-indent)
in my .emacs
file, but it won't indent the current line on pressing <enter>
too!
Another strange behaviour: indentation of case
oneChar c = case lookup c simpleEscapes of | <- what? here?!
It sounds like you type <Enter>
and then "|
" and then <Tab>
. If I do that, I get the same results. But if I type <Enter>
and then <Tab>
and then <Tab>
again it automatically inserts the "|
" and lines it up correctly, like so:
data MyADT = Oh | Hi |<Cursor>
When I check my haskell-mode version using M-x eval-expression haskell-version <Enter>
I get "v2_4".
Emacs haskell-mode doesn't fully analyze the source code, so the "automatic" features are approximate, I think. Typing <Tab>
several times on a new line cycles through several possible indentations, and also sometimes inserts text like the "|
" for algebraic data types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With