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.

DJG
  • 6,413
  • 4
  • 30
  • 51
  • 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- – Leon Grapenthin Sep 10 '13 at 15:59

1 Answers1

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.

Michiel Borkent
  • 34,228
  • 15
  • 86
  • 149