我从git(0.1.6预览,通过el-get食谱)使用nrepl.el,我想clojure缓冲区evals:Cx Ce,CMx,Cc Cr形式,顶级形式和区域分别将自己发送到nrepl缓冲区并在那里进行评估,而不是使用返回到回显区域的结果评估屏幕的默认行为。
有任何方式
感谢。
div但是好消息是你在这里在emacs-land中,因此应该可以编写自己的自定义处理程序,将输出定向到nrepl缓冲区,并根据需要调整键绑定。
例如,这相当于Cx Ce,但将评估结果发送到repl缓冲区而不是minibuffer:
defun my-interactive-eval-to-repl(form)(let((buffer nrepl-nrepl-buffer))(nrepl-send-string form(nrepl-handler buffer)nrepl-buffer- ns))) (defun my-eval-last-expression-to-repl()(interactive)(my-interactive-eval-to-repl -last-expression)))
I'm using nrepl.el from git (0.1.6-preview, via el-get recipe), and I would like clojure buffer evals: C-x C-e, C-M-x, C-c C-r for form, top-level form and region respectively, to send themselves to the nrepl buffer and evaluate there, rather than the default behavior of evaluating off-screen with results returned to the echo area.
Is there any way to do this, or is there another set of keybindings for this purpose that I'm not recognizing by their descriptions?
Thanks.
解决方案The behavior you described is not presently supported in nrepl.el.
But the good news is you are in emacs-land, so it should be possible to write your own custom handler to direct the output to the nrepl buffer and adjust your key bindings if you like.
For example, this is the equivalent of C-x C-e but sends the result of the evaluation to the repl buffer instead of the minibuffer:
(defun my-interactive-eval-to-repl (form) (let ((buffer nrepl-nrepl-buffer)) (nrepl-send-string form (nrepl-handler buffer) nrepl-buffer-ns))) (defun my-eval-last-expression-to-repl () (interactive) (my-interactive-eval-to-repl (nrepl-last-expression)))
更多推荐
nrepl.el:如何评估clojure缓冲区形式到nrepl缓冲区而不是回波区?
发布评论