Skip to content

Commit

Permalink
Merge pull request #377 from dra27/lib-layout
Browse files Browse the repository at this point in the history
Support new Load_path.init API
  • Loading branch information
kit-ty-kate committed Jun 15, 2022
2 parents 4261416 + fbbaec6 commit ecda59a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/lib/uTop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -854,11 +854,16 @@ let () =
+-----------------------------------------------------------------+ *)

#if OCAML_VERSION >= (4, 08, 0)
let get_load_path ()= Load_path.get_paths ()
let set_load_path path= Load_path.init path
let get_load_path () = Load_path.get_paths ()
#if OCAML_VERSION >= (5, 0, 0)
let set_load_path path =
Load_path.init path ~auto_include:Load_path.no_auto_include
#else
let get_load_path ()= !Config.load_path
let set_load_path path= Config.load_path := path
let set_load_path path = Load_path.init path
#endif
#else
let get_load_path () = !Config.load_path
let set_load_path path = Config.load_path := path
#endif

(* +-----------------------------------------------------------------+
Expand Down
4 changes: 4 additions & 0 deletions src/lib/uTop_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,11 @@ let emacs_mode = ref false
let preload = ref []

let prepare () =
#if OCAML_VERSION >= (5, 0, 0)
Toploop.set_paths ~auto_include:Load_path.no_auto_include ();
#else
Toploop.set_paths ();
#endif
try
let ok =
List.for_all
Expand Down

0 comments on commit ecda59a

Please sign in to comment.