Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When emacs starts it inherits the environment variables that are set at the time, either in the launching application (Linux) or in a central repository (the Windows registry).

On Windows, environment variables can be set globally. How could I prompt emacs to refresh its list of environment variables ?

I'm also interested on ways to refresh the variables on Linux (those changed in the shell that launched emacs), tough it seems much harder since there is no central repository of environment variables. Maybe by playing with emacsclient ?

share|improve this question
    
Could you explain a little bit what Problem you're trying to solve? Why do you need to communicate through the Environment like this? –  djf Aug 17 '12 at 10:44
    
A simple case is installing a new command-line program. On Windows it might end up in "C:\Program Files\My Program\" for instance. To use this program on the command line, I need to add this path to the PATH environment variable. I use the emacs shell, and therefore I need to restart emacs (or add the variable to the environment manually in emacs) in order to make use of the new program. –  Norswap Aug 17 '12 at 11:23

1 Answer 1

Maybe you could create an external script which collects the names and values of environment variables then sends these name-value pairs to the running emacs via emacsclient, so emacs can set its own environment according to the received values with setenv.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.