Skip to content

Instantly share code, notes, and snippets.

@jvillste
Forked from RickMoynihan/ricks-clojure.el
Created September 9, 2011 20:33
Show Gist options
  • Save jvillste/1207261 to your computer and use it in GitHub Desktop.
Save jvillste/1207261 to your computer and use it in GitHub Desktop.
elisp for SLIME and swank-clojure
(defun clojure-reset-namespace ()
"Reloads the current Clojure namespace by first removing it and
then re-evaluating the slime buffer. Use this to remove old
symbol definitions and reset the namespace to contain only what
is defined in your current Emacs buffer."
(interactive)
(save-buffer)
(slime-interactive-eval (concat "(remove-ns '" (slime-current-package) ")"))
(slime-compile-and-load-file))
(defun clojure-switch-repl-to-current-namespace ()
"Switch the REPL to the current clojure files namespace"
(interactive)
(slime-repl-send-string (concat "(ns " (slime-current-package) ")")))
@jvillste
Copy link
Author

jvillste commented Sep 9, 2011

This clojure-reset-namespace version shows compiler errors better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment