Function: tuareg-run-process-if-needed
tuareg-run-process-if-needed is a natively compiled function defined
in tuareg.el.
Signature
(tuareg-run-process-if-needed &optional CMD)
Documentation
Run an OCaml REPL process if needed, with an optional command name.
I/O via buffer *OCaml*.
Source Code
;; Defined in /nix/store/6mbh851dhnag8f92qfrlh9ckldzwf6c6-emacs-packages-deps/share/emacs/site-lisp/elpa/tuareg-20260626.936/tuareg.el
(defun tuareg-run-process-if-needed (&optional cmd)
"Run an OCaml REPL process if needed, with an optional command name.
I/O via buffer `*OCaml*'."
(if cmd
(setq tuareg-interactive-program cmd)
(unless (comint-check-proc tuareg-interactive-buffer-name)
(setq tuareg-interactive-program
(read-shell-command "OCaml REPL to run: "
tuareg-interactive-program))))
(unless (comint-check-proc tuareg-interactive-buffer-name)
(let ((cmdlist (tuareg--split-args tuareg-interactive-program))
(process-connection-type t))
(set-buffer (apply (function make-comint) "OCaml"
(car cmdlist) nil (cdr cmdlist)))
(tuareg-interactive-mode)
(sleep-for 1))))