Add script for cleaning up whitespace

This commit is contained in:
Ryan C. Thompson 2012-02-13 15:57:19 -08:00
parent 6cfcc56a91
commit e41a8933b0

5
cleanup-whitespace.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
SETUP='(progn (defun cleanup-whitespace () (message "Cleaning whitespace %s" (buffer-file-name)) (setq indent-tabs-mode nil require-final-newline t) (untabify (point-min) (point-max)) (indent-region (point-min) (point-max)) (delete-trailing-whitespace (point-min) (point-max)) (save-buffer)) (add-hook (quote find-file-hook) (function cleanup-whitespace)) (add-to-list (quote auto-mode-alist) (quote ("\\.[rR][cC][pP]$" . emacs-lisp-mode))))'
find . -name '*.el' -o -name '*.rcp' | xargs -- emacs -Q -l simple -batch --eval "$SETUP"