ocaml-community / utop

Universal toplevel for OCaml
Other
833 stars 110 forks source link

Customize starting directory for utop #472

Open benbellick opened 7 months ago

benbellick commented 7 months ago

Hi! I opened up #471 . I use utop-mode but wanted to automatically load in my .ocamlinit file at the root level of my project without having to pass it in explicitly using the -init flag. My solution is to enable a customization to start utop from the project root dir.

Now when you set the variable utop-starting-directory (possibly via customize) to 'project-root, project.el is used to find the current buffer's project root. Then utop is called from that directory. If the project cannot be found, an error is thrown.

benbellick commented 7 months ago

This actually breaks completion when the directory is set to the project root. Will investigate more but if you have any ideas what might cause this issue, please let me know! Thanks