This is a simple lisp function for Emacs (or XEmacs) that indents a file and removes all tabs, according to the Crossfire programming guide.
;;; Fixes the indentation of a file at 4 spaces per indent, ;;; and replaces all tabs with spaces. ;;; To use on code.c in batch mode, save as indent.el, and run: ;;; ;;; emacs -batch code.c -l indent.el -f indent-a-file -kill ;;; (defun indent-a-file () (setq c-basic-offset 4) (indent-region (point-min) (point-max) nil) (untabify (point-min) (point-max)) (save-buffer) )