2

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."
  (interactive)
  (cider-repl-set-ns (cider-current-ns))
  (if (region-active-p)
      (cider-insert-region-in-repl (region-beginning) (region-end)))
  (cider-load-buffer-and-switch-to-repl-buffer))

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

closed as off-topic by Gilles Feb 4 '17 at 20:03

  • This question does not appear to be about emacs, within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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. – Gilles Feb 4 '17 at 20:03
2

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 – Facundo Olano 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.