fstamour
fstamour

Reputation: 797

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. 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

Answers (2)

fstamour
fstamour

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

abo-abo
abo-abo

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

Related Questions