In Clojure We Trust

A piece of intertube about the Clojure programming language, algorithms and Emacs.

Updating Clojure Namespaces

Continuing my experimentations with Emacs Lisp, I created a function that automatically updates the namespace of a Clojure buffer in conformity with its pathname. This is useful after renaming a file, since changing a file pathname requires to change its namespace, which is sometimes annoying to do by hand.
Once added to your .emacs file, you can call it with:
M-x clojure-update-ns

It assumes clojure-mode is already loaded.

Comments

Kototama
Thanks! An improved version of this function, called clojure-update-ns, has been integrated into the latest clojure-mode.el, available at https://github.com/technomancy/clojure-mode
Anonymous
Great little function - thank you! Next step would be to create one that recursively traverses a directory applies this to every .clj file found :)