简体   繁体   English

在emacs中评估* nrepl *缓冲区中的Clojure命名空间

[英]Evaluate Clojure namespace in *nrepl* buffer in emacs

After creating a project with lein new , I open my core.clj in emacs and launch nrepl . 在使用lein new创建项目后,我在emacs中打开我的core.clj并启动nrepl

The *nrepl* buffer shows up and looks something like this: *nrepl*缓冲区出现并看起来像这样:

; nREPL 0.1.6-preview
user> 

Okay, but now I want to change the namespace, so I decide to evaluate or Cc Ce the namespace expression. 好的,但现在我想更改命名空间,所以我决定评估或Cc Ce命名空间表达式。 Assume the expression in core.clj looks something like this: 假设core.clj的表达式如下所示:

(ns my-project.core)

Yet, nothing happens in the *nrepl* buffer. 然而, *nrepl*缓冲区中没有任何*nrepl* If I want, I can evaluate the namespace expression by entering it directly inside the *nrepl* buffer, and everything runs smoothly. 如果我愿意,我可以通过直接在*nrepl*缓冲区内输入来评估命名空间表达式,并且一切运行顺利。

My question is: Why wouldn't I be able to evaluate a namespace expression by using Cc Ce ? 我的问题是:为什么我不能通过使用Cc Ce来评估命名空间表达式? 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. 如果这是正常的,正确的行为,我想知道它的基本原理以及elisp解决方法来获得我想要的行为。

Type Cc Mn: Cc Mn类型:

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

Switch the namespace of the repl buffer to the namespace of the current buffer. 将repl缓冲区的名称空间切换到当前缓冲区的名称空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM