Replace deprecated Lwt_sequence with LTerm_dlist

This commit is contained in:
ncihnegn 2018-07-14 00:45:19 -07:00 committed by Jérémie Dimino
parent 03b383bd58
commit 239e6aad95
4 changed files with 10 additions and 9 deletions

View File

@ -33,8 +33,8 @@ let stashable_session_history = UTop_history.create ()
| Hooks |
+-----------------------------------------------------------------+ *)
let new_command_hooks = Lwt_sequence.create ()
let at_new_command f = ignore (Lwt_sequence.add_l f new_command_hooks)
let new_command_hooks = LTerm_dlist.create ()
let at_new_command f = ignore (LTerm_dlist.add_l f new_command_hooks)
(* +-----------------------------------------------------------------+
| Config |
@ -813,7 +813,7 @@ let load_path = Config.load_path
+-----------------------------------------------------------------+ *)
let smart_accept = ref true
let new_prompt_hooks = Lwt_sequence.create ()
let at_new_prompt f = ignore (Lwt_sequence.add_l f new_prompt_hooks)
let new_prompt_hooks = LTerm_dlist.create ()
let at_new_prompt f = ignore (LTerm_dlist.add_l f new_prompt_hooks)
let prompt_continue = ref (S.const [| |])
let prompt_comment = ref (S.const [| |])

View File

@ -264,7 +264,7 @@ val prompt : LTerm_text.t React.signal ref
(** {6 Hooks} *)
val new_command_hooks : (unit -> unit) Lwt_sequence.t
val new_command_hooks : (unit -> unit) LTerm_dlist.t
(** Functions called before each new command. *)
val at_new_command : (unit -> unit) -> unit
@ -370,5 +370,5 @@ val load_path : string list ref
val prompt_continue : LTerm_text.t React.signal ref
val prompt_comment : LTerm_text.t React.signal ref
val smart_accept : bool ref
val new_prompt_hooks : (unit -> unit) Lwt_sequence.t
val new_prompt_hooks : (unit -> unit) LTerm_dlist.t
val at_new_prompt : (unit -> unit) -> unit

View File

@ -9,6 +9,7 @@
open CamomileLibraryDyn.Camomile
open Lwt_react
open LTerm_dlist
open LTerm_text
open LTerm_geom
open UTop_token
@ -628,7 +629,7 @@ let rec loop term =
UTop_private.set_count (S.value UTop_private.count + 1);
(* Call hooks. *)
Lwt_sequence.iter_l (fun f -> f ()) UTop.new_command_hooks;
LTerm_dlist.iter_l (fun f -> f ()) UTop.new_command_hooks;
(* Read interactively user input. *)
let phrase_opt =
@ -953,7 +954,7 @@ module Emacs(M : sig end) = struct
UTop_private.set_count (S.value UTop_private.count + 1);
(* Call hooks. *)
Lwt_sequence.iter_l (fun f -> f ()) UTop.new_command_hooks;
LTerm_dlist.iter_l (fun f -> f ()) UTop.new_command_hooks;
(* Tell emacs we are ready. *)
send "prompt" "";

View File

@ -13,7 +13,7 @@ depends: [
"base-unix"
"base-threads"
"ocamlfind" {>= "1.7.2"}
"lambda-term" {>= "1.2"}
"lambda-term" {>= "1.13"}
"lwt"
"lwt_react"
"camomile"