I tried it here and it works well.
Try the following:
- Start emacs with the scm file:
emacs myfile.scm &
- If Emacs just shows a welcoming screen, press CTRL-g.
- On the status line towards the bottom of the window, it should
say
myfile.scm ... (Scheme) ....
If it doesn't say "(Scheme)", but for example "(Fundamental)",
then it means that your Emacs installation doesn't automatically
load the Scheme mode for .scm files (as far as I know, Emacs
should do it by default).
- If it indeed says (Scheme), try to run
CTRL-x h
ALT-x indent-region
and verify that it corrects the indentation of the file.
If all this works, I have no idea why the batch version doesn't.