Slime defines two commands: slime-call-defun and slime-eval-last-expression-in-repl which take the function name of where point is (or whatever) and copy it over to the REPL prompt and position point accordingly.

Is there such a functionality for Sly and how do I use it?
If not, is there some openly available elisp code, which I could use to achieve this?
If there is no such functionality available, which workflow is intended?

1 Answer 1


Since no one answered, I've done a naive implementation. This is a community wiki answer in hope, the implementation evolves over time.

(defun my-sly-copy-call-to-repl ()
  "Copy name/symbol of toplevel sexp to sly-mREPL and select sly-mREPL."
  (let (string
      (forward-thing 'symbol 2)
      (setq string (format "(%s )" (thing-at-point 'symbol 'no-props))))
    (setq replwin (get-buffer-window (call-interactively #'sly-mrepl)))
    (with-selected-window replwin
      (insert string)
      (forward-char -1))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.