ignore breaks while reading a line in emacs
Ignore-this: 8983f41fefddaf597300d9679f5c798d darcs-hash:20120202141920-c41ad-374eaecb31bfbe820440d4380f7757e3c7071b1c
This commit is contained in:
parent
c1ff52459d
commit
ff8ef4b766
|
@ -66,8 +66,18 @@ let input = ref ""
|
|||
(* The position of the text already sent to ocaml in {!input}. *)
|
||||
let pos = ref 0
|
||||
|
||||
let read_line () =
|
||||
let behavior = Sys.signal Sys.sigint Sys.Signal_ignore in
|
||||
try
|
||||
let line = Lwt_main.run (Lwt_io.read_line_opt Lwt_io.stdin) in
|
||||
Sys.set_signal Sys.sigint behavior;
|
||||
line
|
||||
with exn ->
|
||||
Sys.set_signal Sys.sigint behavior;
|
||||
raise exn
|
||||
|
||||
let read_command () =
|
||||
match Lwt_main.run (Lwt_io.read_line_opt Lwt_io.stdin) with
|
||||
match read_line () with
|
||||
| None ->
|
||||
None
|
||||
| Some line ->
|
||||
|
|
|
@ -428,12 +428,14 @@ sub-process."
|
|||
(defun utop-interrupt ()
|
||||
"Interrupt utop."
|
||||
(interactive)
|
||||
(interrupt-process utop-process))
|
||||
(with-current-buffer utop-buffer-name
|
||||
(interrupt-process utop-process)))
|
||||
|
||||
(defun utop-kill ()
|
||||
"Kill utop."
|
||||
(interactive)
|
||||
(kill-process utop-process))
|
||||
(with-current-buffer utop-buffer-name
|
||||
(kill-process utop-process)))
|
||||
|
||||
;; +-----------------------------------------------------------------+
|
||||
;; | The mode |
|
||||
|
|
Loading…
Reference in New Issue