0

When I define a function in Emacs Lisp mode, you can evaluate it with moving the pointer to the last parenthese of a function, and do C-xC-e. Aka calling eval-last-sexp.

I thought this is somewhat a cumbersome. So I bound the key C-e to eval-defun. So every time you define a new setq definition or a function, you can evaluate it with eval-defun without the need to move your pointer to the latest parenthese first.

Now I'm trying Clojure in pair with CIDER. I noticed you need to move to the latest parenthese and then call cider-eval-last-sexp. I would like to eval the current function/whatever where my cursor is, where the pointer is.

But I couldn't find any Clojure/Cider alternative for ELisp's eval-defun. Any suggestion for a function would be appreciated.

  • Sounds like it's time for a feature request. – PythonNut Dec 27 '15 at 2:49
3

C-M-x does the right thing in Clojure buffers for me after spawning a REPL. To look up what command is bound to it, use F1 k <key sequence> and you'd find out that it's cider-eval-defun-at-point.

  • Never discovered the C-M-x and thus cider-eval-defun-at-point. Thanks for your answer! – ReneFroger Dec 27 '15 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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