I wrote this command and key binding to use with cider for Clojure development:

(defun reload-and-eval-in-repl ()
  "Set the ns of the repl to the one in the current buffer, then eval the region of the whole buffer in the repl and switch to it."
  (cider-repl-set-ns (cider-current-ns))
  (if (region-active-p)
      (cider-insert-region-in-repl (region-beginning) (region-end)))

(define-key clojure-mode-map (kbd "s-e") 'reolad-and-eval-in-repl)

This works just as I expected if I run it like M-x reload-and-eval-in-repl or I eval the expression (reload-and-eval-in-repl), but when I try to use the keybinding s-e I get the error:

Wrong type argument: commandp, reolad-and-eval-in-repl

I know that error usually means you forgot the (interactive) call, but this isn't the case, so I'm a bit lost.

  • I'm closing this question because it is about a problem that went away when a typo was fixed and the answer does not lead to a teachable moment. Feb 4 '17 at 20:03

You have bound an imaginary command: reolad-and-eval-in-repl.

Your command is named reload-and-eval-in-repl.

  • 1
    thanks, I feel dumb but it's one of those things you need another set of eyes to notice Feb 4 '17 at 1:33
  • 4
    We've all been there, over and over, and will continue to be. :-)
    – Drew
    Feb 4 '17 at 2:36

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