Search code examples
emacslispcommon-lispslime

In Slime REPL (GNU EMACS), what is the shortcut to clear the current input


In Slime, I would like to clear the input I have currently typed into the REPL topline. What is the shortcut?

For example, if I type the below, it is missing one parenthesis and will not execute. How do I simply clear the whole text from my input line? I.e. instead of having to manually press delete on each character

 (let* ((x 5) (y (+ x x))
  (print y))

I could not find anything here: https://common-lisp.net/project/slime/doc/html/REPL-commands.html

These solutions seem to be different (but please correct me if I'm wrong) and relate to the whole screen, while I'm interested in clearing what I have typed but not yet evaluated:

emacs cider clear REPL buffer In emacs, how do I bind C-l to clear screen in slime?


Solution

  • It's C-c C-u, which is slime-repl-kill-input. A good trick is to use C-h b which will cause Emacs to show you the current bindings in a help buffer: you can then search through them looking for likely candidates. C-h m is also useful to show help on the current mode, which should show you the bindings as well (but may not: I'm not sure if it always does). The advantage of these things is that they show you what actually exists rather than what the manual thinks exists which may not be the same thing (even when there is a manual...).