purcell / envrc

Emacs support for direnv which operates buffer-locally
378 stars 35 forks source link

Unload environment with envrc--update when there is no envrc file #20

Closed jellelicht closed 3 years ago

jellelicht commented 3 years ago

Is this hideous? Yes. Is this correct? No.

Does this work? It does, for me 😄

Fwiw, adding envrc—update to both eshell-load-hook and eshell-directory-change-hook make this fairly convenient to work with from eshell.

purcell commented 3 years ago

Thanks, but please could you explain the scenario this fixes, ie. with a sequence of actions and observed/expected results?

jellelicht commented 3 years ago

My example is about eshell, but it should really work with any buffer that can have changes to the value of its default-directory. Right now, after ‘activating’ a direnv environment with envrc-reload or envrc-load, you are stuck with it; you can either choose to ‘reload’ a different environment, or disable envrc entirely.

Imagine I have an .envrc in ~/Documents:

Now I have my envrc environment available;

purcell commented 3 years ago

Great, yes, that makes sense. Merged, thank you!