Reputation: 797
I never really use the REPL and I find annoying that it pops up every time I connect to a swank instance. How can I prevent SLIME to switch to the repl buffer?
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
Upvotes: 4
Views: 415
Reputation: 797
Here was my solution, thanks to @abo-abo's answer.
(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)))
Upvotes: 1
Reputation: 20372
Here's how I've done it in 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)))))
Upvotes: 4