Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize starting directory for utop #472

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

benbellick
Copy link

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.

utop can be starting from either:
 - the directory of the opened buffer, or
 - the project-root directory (via project.el)

This is useful if you have an `.ocamlinit` file in your project root.

Because there is not a clear reason for setting a specific
directory (no difference for utop other than `.ocamlinit`, that option
has been omitted.

Modeled after elpy-shell.el
@benbellick
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant