Created
April 12, 2016 06:17
-
-
Save fgui/9b44a9f0bd1f3787a4580a18e7a39dc7 to your computer and use it in GitHub Desktop.
format clj on save cider/emacs
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
;; it formats buffer and attempts to return to original position. | |
(defun cider-format-buffer-back () (interactive) | |
(let (p) | |
(setq p (point)) | |
(cider-format-buffer) | |
(goto-char p)) | |
) | |
(defun add-clj-format-before-save () (interactive) | |
(add-hook 'before-save-hook | |
'cider-format-buffer-back | |
t t)) | |
(add-hook 'clojure-mode-hook | |
'add-clj-format-before-save) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment