You can use emacs in batch mode. For example, you can create the indent.el file
(defun my/indent-file (fPath) (let ((buffer (find-file fPath))) (message (concat "indenting file " fPath)) (indent-region (point-min) (point-max)) (save-buffer) (kill-buffer buffer))) (mapcar 'my/indent-file argv)
and then call emacs like this to postpone a bunch of files (note that it will work for any emacs language that can recognize and learn how to backtrack):
emacs --load indent.el --batch MY_LISP_FILES
See this page for more information on idiomatic ways to use emacs for batch processing.
Edit
Here is a single-line file that works with only one file, but does not use the argv variable (be careful: the order of the arguments is important):
emacs --batch MY_FILE --eval '(indent-region (point-min) (point-max))' -f 'save-buffer'
source share