i am using cider. I want to do the following: when I finish editing in a source buffer, I want to compile the source and execute it in the repl, all with a single key-binding.

In cider-mode, compiling source can be done by C-c C-k or M-x some-function, so the workflow is basically like this: C-c C-k, C-c C-z (switch to repl buffer), and type and execute my-function. How do I bind all the actions together and popup the repl buffer with results?


The normal way to do this within a session is to record the actions as a keyboard macro, and then bind that macro to a key. You can also save the macro and binding to a file to use it across sessions. The details are provided in the Emacs manual.


Have you tried the already defined shortcut?

C-c M-e

It evaluates the form preceding point and outputs to REPL buffer. See other cider mode shortcuts here.

  • you see: maybe, i am editing namespace a.b, and will execute x.y/z in the repl, so it's not that easy by adding a.b/c in namespace a.b and C-c M-e. – 象嘉道 Jun 24 '15 at 17:33
  • I'm afraid I don't follow you, but did you look at other shortcuts that mode offers. It was developed by the people who developed cider, so I'm sure they have your case covered that I have missed. – Emacs User Jun 24 '15 at 17:43

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.