Skip to content

Instantly share code, notes, and snippets.

@manjilab
Created November 12, 2009 18:55
Show Gist options
  • Save manjilab/233171 to your computer and use it in GitHub Desktop.
Save manjilab/233171 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
filename = "/tmp/tmptx_tidyClojurecode.clj";
File.open(filename, "w") {|f|
STDIN.each do |line|
f.print line
end
}
result = `emacs -batch \
--eval '(load "~/opt/clojure-mode/clojure-mode")' \
#{filename} \
--eval '(setq-default tab-width 8 indent-tabs-mode nil)' \
--eval '(indent-region (point-min) (point-max) nil)' \
-f save-buffer &> /dev/null`
puts `cat #{filename}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment