Search code examples
emacscommon-lispslimedot-emacs

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


Solution

  • 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)))))