简体   繁体   中英

Inputing data in OCaml toplevel runnin under Emacs

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.

在此处输入图片说明

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

just type as usal an use Mx comint-send-input directly, so tuareg won't check for the terminating ;;

edit: of course, you can define a keyboard shortcut for it, if you need it regularly; eg

 (add-hook 'tuareg-interactive-mode-hook
  '(lambda ()
      (local-set-key (kbd "C-n") 'comint-send-input)))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM