我从来没有真正使用过REPL,我觉得每次连接到swank实例时都会弹出它。如何防止SLIME切换到repl缓冲区?
我试图在slime的代码中找到它的位置,但是当你不确定要查找什么时它会很大。
由于
答案 0 :(得分:4)
以下是我在lispy中的表现:
(defun lispy--eval-lisp (str)
"Eval STR as Common Lisp code."
(require 'slime-repl)
(unless (slime-current-connection)
(let ((wnd (current-window-configuration)))
(slime)
(while (not (and (slime-current-connection)
(get-buffer-window (slime-output-buffer))))
(sit-for 0.2))
(set-window-configuration wnd)))
(let (deactivate-mark)
(cadr (slime-eval `(swank:eval-and-grab-output ,str)))))
答案 1 :(得分:1)
这是我的解决方案,感谢@ abo-abo的回答。
(defun my-slime-connect () (interactive)
(let ((wnd (current-window-configuration)))
(call-interactively 'slime-connect)
(sit-for 0.2) ;; Not sure if necessary, haven't tested without it.
(set-window-configuration wnd)))