Created
June 13, 2016 22:17
-
-
Save client9/eeb9e905729a1ba182758e4febacd16e to your computer and use it in GitHub Desktop.
emacs snippet for batch reformatting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun buffer-untabify () | |
"Untabify an entire buffer" | |
(interactive) | |
(untabify (point-min) (point-max)) | |
(delete-trailing-whitespace)) | |
(defun buffer-indent() | |
"Reindent an entire buffer" | |
(interactive) | |
(indent-region (point-min) (point-max) nil)) | |
(defun buffer-cleanup() | |
"Untabify and re-indent an entire buffer" | |
(interactive) | |
(if (equal buffer-file-coding-system 'undecided-unix ) | |
nil | |
(set-buffer-file-coding-system 'undecided-unix)) | |
(buffer-untabify) | |
(buffer-indent) | |
(delete-trailing-whitespace)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment