follow OCaml's output in emacs

Ignore-this: 20e2a63a90783cbcfbe273732293188b

darcs-hash:20120321131824-c41ad-cf97daa2d551f812603bc30f955a94d0e39478e1
This commit is contained in:
Jeremie Dimino 2012-03-21 14:18:24 +01:00
parent 543b99ab35
commit 4264dc3d92
1 changed files with 10 additions and 1 deletions

View File

@ -63,6 +63,12 @@ If nil, `utop-command' will be used without modification."
:type 'boolean
:group 'utop)
(defcustom utop-follow-output t
"Whether to follow OCaml's output while it is executing a
phrase."
:type 'boolean
:group 'utop)
(defcustom utop-prompt 'utop-default-prompt
"The function which create the prompt for utop."
:type 'function
@ -412,7 +418,10 @@ it is started."
(setq utop-prompt-min (+ utop-prompt-min (length line)))
(setq utop-prompt-max (+ utop-prompt-max (length line)))
;; Make everything before the end prompt read-only
(add-text-properties (point-min) utop-prompt-max utop-non-editable-properties))))
(add-text-properties (point-min) utop-prompt-max utop-non-editable-properties)))
;; If OCaml is executing a phrase, follow its output
(when (and utop-follow-output (eq utop-state 'wait))
(utop-goto-point-max-all-windows)))
(defun utop-insert-prompt (prompt)
"Insert the given prompt."