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

julia-repl-activate-parent should start Julia with --project=... if it starts a new session #135

Open
chriselrod opened this issue Jan 6, 2023 · 2 comments

Comments

@chriselrod
Copy link

This is a feature request.

The motivation is that the home project and the project one is working in may have incompatible package versions, some of which get loaded in the startup.jl.

That is, if starting julia with julia --project=my/project, my/project gets activated before startup.jl gets loaded, so the incompatible versions between my/project and the default environment aren't an issues.

If I start julia (running startup.jl) and then activate my/project, some packages in it will fail to precompile because of the conflicts.

My current workaround is to add --startup=no to the Julia repl-switches.

But it'd be nice not to need this.
(Of course that means I'd have to launch the julia-repl via C-c C-a, but I normally do that anyway.)

It looks like an implementation could call julia-repl--locate-live-buffer.
If it returns non-nill, send the string like the implementation currently does.
Otherwise, replicate the logic from julia-repl-inferior-buffer, but with the --project= switch added to julia-repl-switches.

@tpapp
Copy link
Owner

tpapp commented May 29, 2023

I am happy to address this, but what should the project directory be? whereever a Project.toml is found in the parent directories, when julia-repl is called from a buffer that is associated with a file?

@hexaeder
Copy link
Contributor

For me, setting (setq julia-repl-switches "--project=@.") totally did the trick. Normally I'll activate the repl from some file withing the project and @. seems to work fairly well in just activating what i mean. Havn't tested it with nested test environments though.

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

No branches or pull requests

3 participants