Created
February 18, 2011 08:54
-
-
Save malcolmsparks/833433 to your computer and use it in GitHub Desktop.
Closeup closing parens in Clojure files - put in starter-kit-defuns.el if using the emacs starter kit
This file contains hidden or 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
;; | |
;; Author: Malcolm Sparks | |
(defun closeup-parens () | |
(interactive) | |
(save-excursion | |
(replace-regexp "[ \t\n]+)" ")" nil (point-min) (point-max)) | |
(replace-regexp "([ \t\n]+" "(" nil (point-min) (point-max)) | |
(replace-regexp "[ \t\n]+}" "}" nil (point-min) (point-max)) | |
(replace-regexp "[ \t\n]+]" "]" nil (point-min) (point-max)) | |
)) | |
(defun cleanup-buffer () | |
"Perform a bunch of operations on the whitespace content of a buffer." | |
(interactive) | |
(indent-buffer) | |
(untabify-buffer) | |
(closeup-parens) | |
(delete-trailing-whitespace)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment