purcell / exec-path-from-shell

Make Emacs use the $PATH set up by the user's shell
Other
1.43k stars 82 forks source link

How to test if an environment variable exists? #47

Closed 0x7FFFFFFFFFFFFFFF closed 4 years ago

0x7FFFFFFFFFFFFFFF commented 8 years ago

Hi guys,

I want to know how to test if an environment variable exists and I only want to "copy" it when it exists. I want this is because I need to work on several computers and they have slightly different environment variables set.

Thanks.

purcell commented 8 years ago

Well, if you copy a variable which isn't set, then the value in Emacs will be nil, so I'm not sure what you want. Can you give an example of what outcome you're looking for, and how the current result is different from what you want?