purcell / envrc

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

Interaction with other packages using process-environment is hard to manage #88

Open jellelicht opened 2 months ago

jellelicht commented 2 months ago

I currently use with-editor in eshell (using with-editor-export-editor) to set the environment variable EDITOR to something that allows me to use the current Emacs instance in most situations.

envrc--clear currently (and obviously) clears the local variable process-environment, with no option to preserve or restore e.g. my EDITOR configuration as generated by with-editor.

Would it be possible to preserve or restore some aspects of the process-environment in a user-configurable way? I am aware that this could lead to weird situations if the chosen aspect is one that is also modified in the course of loading the .envrc file, as that would mean this modified value can no longer effectively be 'unloaded', but that seems a footgun I personally would be willing to deal with.

Please feel free to close if you think this edge case is out of scope for the project.