简体   繁体   English

防止SLIME切换到repl缓冲区

[英]Prevent SLIME to switch to the repl buffer

I never really use the REPL and I find annoying that it pops up every time I connect to a swank instance. 我从来没有真正使用REPL,我发现每次连接到swank实例时都会弹出它。 How can I prevent SLIME to switch to the repl buffer? 如何防止SLIME切换到repl缓冲区?

I tried to find where it does that in slime's code, but it's kind of huge when you're not sure what to look for. 我试图在史莱姆的代码中找到它的位置,但是当你不确定要寻找什么的时候它会有点大。

Thanks 谢谢

Here's how I've done it in lispy : 这是我在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)))))

Here was my solution, thanks to @abo-abo's answer. 这是我的解决方案,感谢@ 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)))

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

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