On Sat, Mar 30, 2013 at 2:13 PM, John Cowan <xxxxxx@mercury.ccil.org> wrote:
Mark H Weaver scripsit:

> Those of us who use Emacs don't have to figure out what to line up,
> because it simply does it for us.  This is how the vast majority of
> Schemers write code.

I don't, but I would like to be able to run my code through the Emacs
formatter for publication purposes.  Does anyone know how to do this
from the command line?  I do have Emacs installed.

emacs --batch FOO.scm --eval '(indent-region (point-min) (point-max))' -f 'save-buffer' 

Argument order is important.
See http://stackoverflow.com/a/9825272/239657 for multi-file version, or just use a bash loop. 

One indentation quirk that might surprise you is comment-only lines indented to far right.
Emacs uses convention of:
 ; comment on right, even on comment-only line.
 ;; comment indented as code.
 ;;; comment in column 0, even in middle of code.