3

After creating a project with lein new, I open my core.clj in emacs and launch nrepl.

The *nrepl* buffer shows up and looks something like this:

; nREPL 0.1.6-preview
user> 

Okay, but now I want to change the namespace, so I decide to evaluate or C-c C-e the namespace expression. Assume the expression in core.clj looks something like this:

(ns my-project.core)

Yet, nothing happens in the *nrepl* buffer. If I want, I can evaluate the namespace expression by entering it directly inside the *nrepl* buffer, and everything runs smoothly.

My question is: Why wouldn't I be able to evaluate a namespace expression by using C-c C-e? And if this is the normal, and correct behavior, I would like to know its rationale as well as an elisp workaround to get my desired behavior.

1
  • 2
    Evaluating the namespace form doesn't blast you into the namespace. Use (in-ns 'my-project.core) or the short-cut of Michiel's answer- Commented Sep 10, 2013 at 15:59

1 Answer 1

4

Type C-c M-n:

https://github.com/clojure-emacs/nrepl.el

Switch the namespace of the repl buffer to the namespace of the current buffer.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.