Whenever I hit enter to get to the next line when writing a function for example emacs indents an addition tabs worth of space. I'll try to sketch out the problem:
fun pow(x : int, y : int) = ----if y = 0 *hits RET* --------then 1 *hits RET* ------------else x * pow(x,y-1)
In this scenario the dashes represent the indentation that is happening and I'm using enter to go to the new line. I'm totally new to emacs so I'm not sure if the issue has to do with a bug or user error? Could someone who is more experienced using emacs please point me the right direction, this behavior is driving me nuts!
Just to clarify a few things, I'm having this same issue on both my PC and Mac. When I say "hits RET" what I really mean is that I'm hitting the ENTER key. I'm assuming that I'm in SML mode because on the bottom line (I forget the technical name for it) it says (SML). I've also changed from FUNDAMENTAL mode to SML-Mode by typing
M-x sml-mode. I'm using Emacs v26.1 and SML-Mode v6.9.
I wanted to also mention that I turned off
electric-indent-mode and now here is the new behavior. I'll type
if ..., hit RET, type
then, hit RET, it goes to the right place. If on the other hand I just type
if, hit RET, hit TAB, type
then - the indentation goes haywire like it was previously. I'm wondering if I'm not hitting the right buttons in the right order or some other really silly beginner's mistake?