简体   繁体   English

emacs-苹果酒模式未连接到苹果酒杰克-REPL

[英]emacs-cider mode not connecting to cider-jack-in repl

I am using emacs for learning clojure. 我正在使用emacs学习clojure。 I have leiningen installed. 我安装了leiningen。 This is how my general workflow goes : 我的一般工作流程如下:

Open eshell in emacs 在emacs中打开eshell

run lein new myapp 运行lein new myapp

cd myapp\\src\\myapp\\core.clj cd myapp\\src\\myapp\\core.clj

write some code. 写一些代码。

Mx cider-jack-in to open the repl Mx cider-jack-in入打开副本

Now when i try Cc Ck to load the file in the repl, it does not go in that but instead in the small emacs command window. 现在,当我尝试使用Cc Ck在repl中加载文件时,它不会进入该文件,而是在小的emacs命令窗口中显示。

My functions are also not visible in the repl. 我的功能在REPL中也不可见。

How do i connect the clojure mode to the repl created with cider-jack-in ? 如何将clojure模式连接到使用cider-jack-in创建的repl?

Clojure is different from many languages because the unit of compilation is the top level expression. Clojure与许多语言不同,因为编译单元是顶层表达。 So when you hit Cc Ck , cider-mode will run the equivalent of load-file on the current buffer and display the result of load buffer in the minibuffer (the space at the bottom of the screen). 因此,当您按下Cc Ck时 ,cider-mode将在当前缓冲区上运行与load-file等效的load-file ,并在minibuffer(屏幕底部的空间)中显示load buffer的结果。 When evaluating Clojure the result of loading a buffer is the last s-expression in that buffer so when evaluation finishes the result of evaluating the bottom of the file will be briefly displayed at the bottom of the screen. 评估Clojure时,加载缓冲区的结果是该缓冲区中的最后一个 s表达式,因此,评估完成时,评估文件底部的结果将短暂显示在屏幕底部。

Once you have loaded the file, you can switch the REPL to that namespace by typing Cc Mn 加载文件后,可以通过键入Cc Mn将REPL切换到该名称空间。

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

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