1

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?

jue
  • 4,476
  • 8
  • 20

1 Answers1

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."
  (interactive)
  (let (string
        replwin)
    (save-excursion 
      (beginning-of-defun)
      (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))))
jue
  • 4,476
  • 8
  • 20