3

When interactively running the OCaml toplevel on Emacs (via the Tuareg mode), evaluation of expression which do input from the standard input channel does not finish.

For instance, when I enter the following expression in the *ocaml-toplevel* buffer and hit enter

let x = read_int ();;

and type some integer and hit ENTER to finish, evaluation is not finished as it was expected.

The following screenshot demonstrates the situation.

enter image description here

What is the proper way of doing input from the standard input channel in the OCaml toplevel buffer in Emacs?

4

1 回答 1

3

只需直接输入 asusal 使用 M-x comint-send-input ,因此 tuareg 不会检查终止;;

编辑:当然,如果您经常需要它,您可以为其定义键盘快捷键;例如

 (add-hook 'tuareg-interactive-mode-hook
  '(lambda ()
      (local-set-key (kbd "C-n") 'comint-send-input)))
于 2015-10-17T21:36:47.757 回答