Closed akirak closed 3 years ago
What strikes me as odd about this issue is that I thought default-directory
would be set, as it's set in a let
binding inside inf-elixir-project
. I can easily imagine inf-elixir
having an odd default-directory
since we never explicitly set one, but inf-elixir-project
should have the root of the project as it's default-directory
already.
If you could do me a favor, what I want to know is the value of default-directory
without your changes:
inf-elixir-project
As you point out in the above comment, default-directory
seems to be correctly set to the project root, and it is working without the change now. I don't know why, but maybe it was due to a temporary situation in my environment. I'll close this issue for now. Thank you for your comment.
I use Nix, nix-direnv, and
direnv-mode
to configure project-specific dependencies. I am currently working on my project that depends on a library that contains Rust NIF, so I have configured Nix and direnv to ensurecargo
is available in my project.When I tried to open a REPL session for the project using
inf-elixir-project
, it failed due tocargo
missing. On the other hand,mix compile
successfully runs on terminal.Apparently, iex does not load the local environment from direnv when inf-elixir starts the session. I think this can be done by setting
default-directory
of the comint buffer, which is implemented in this PR. It seems to be working in my environment, andinf-elixir
now handles the cargo dependency!Hope this is useful.