clojure-emacs/clj-refactor.el — pull request #94 by expez (2014-12-19 21:12:33+00:00)
Title: Add cljr-clean-ns

This new function is bound to "cn" and performs the following cleanup:

* Eliminate :use clauses
* Sort required libraries, imports and vectors of referred symbols
* Rewrite to favor prefix form, e.g. [clojure [string test]] instead
of two separate libspecs
* Raise errors if any inconsistencies are found (e.g. a libspec with more than
one alias.
* Remove any duplication in the :require and :import form.
* Remove any unused libspec vectors
* Remove unused symbols from the :refer vector, or remove it completely.
* Remove any unused imports

It relies on the nrepl middleware to do its thing. In order for the
removal of unused requires and imports to work the NS has to be loaded
into the repl.