0

I do not know what I did, but emacs creates a lot of spaces for new lines. There's a demo:

enter image description here

How to fix this?

Ivan
  • 103
  • 1
  • This looks like automatic indentation for some programming mode. Check active modes (in the mode line at the bottom, or with F1-m) and edit your question to show active modes. – Juancho Jan 31 '19 at 10:48
  • @Juancho looks like PHP mode and SML mode together make this problem. When I disable PHP mode it stops to add spaces when I type `()` and when I disable SML mode it stops to add spaces for new lines. – Ivan Jan 31 '19 at 11:02
  • Maybe you've pressed something by accident. Try typing `F1 l` to see last typed commands after this happens. You should get the command bound to the key as well. –  Jan 31 '19 at 12:28
  • If you don't see this when you start Emacs using `emacs -Q` (no init file) then something in your init file is causing the problem. Bisect your init file to find the problem. If it turns out to be caused by some package you use then check the options of that package, or make your question more precise, mentioning the package etc. – Drew Jan 31 '19 at 15:37

1 Answers1

0

You seem to be on the scratch buffer and I think emacs is trying to match the indent level of the line above. If you remove the lines above and try again it shouldn't add any spaces. Emacs usually indents everything according to the working language, but as I'm not familiarized with sml and I can't say if the behavior is correct.

If after you remove the lines above you still have issues with the indentation, you should try again emacs -Q to check if it's something related to your config. In case you the issues persist, you should file a bug or look for alternative modes.

Jesse
  • 1,984
  • 11
  • 19