Clearing the OCaml REPL buffer in Tuareg mode for Emacs

Is there a way to clear the OCaml REPL buffer in Tuareg mode for Emacs? I’m going to use the REPL for teaching, and being able to clear the REPL buffer and show a single thing on the screen would be very helpful.

2 Likes

if you want to erase the buffer while keeping in memory the previous let bindings, you could bind this to your choice of key

(let ((inhibit-read-only t)) (erase-buffer))

EDIT: this is better

comint-clear-buffer

2 Likes

It turns out comint-clear-buffer is by default bound to C-c M-o.

Thank you!

1 Like

that’s good to know :wink: