Function: tuareg-interactive-send-input

tuareg-interactive-send-input is an interactive and natively compiled function defined in tuareg.el.

Signature

(tuareg-interactive-send-input)

Documentation

Send the current phrase to the OCaml REPL or insert a newline.

If the point is next to ";;", the phrase is sent to the REPL, otherwise a newline is inserted and the lines are indented.

Key Bindings

tuareg-interactive-mode-map RET

Source Code

;; Defined in /nix/store/6mbh851dhnag8f92qfrlh9ckldzwf6c6-emacs-packages-deps/share/emacs/site-lisp/elpa/tuareg-20260626.936/tuareg.el
(defun tuareg-interactive-send-input ()
  "Send the current phrase to the OCaml REPL or insert a newline.
If the point is next to \";;\", the phrase is sent to the REPL,
otherwise a newline is inserted and the lines are indented."
  (interactive)
  (cond
   ((tuareg-in-literal-or-comment-p) (tuareg-interactive--indent-line))
   ((or (equal ";;" (save-excursion (nth 2 (smie-backward-sexp))))
        (looking-at-p "[ \t\n\r]*;;"))
    (comint-send-input))
   (t (tuareg-interactive--indent-line))))