I don't know if this is a general Emacs issue or clojure/cider specific. Anyway: How do I pass through environment variables which work in the shell and are configured currently in my ~/.profile. Now if I lein repl in my project, this works just fine:
(System/getenv "FOO")
-> "BAR
But when I cider-jack-in in my project, the CIDER repl can't see the variable:
(System/getenv "FOO")
-> nil
I'm using the GUI (Cocoa) version of Emacs version 24.4.50. Cider version is cider-20140718.747.
You can either, as noisesmith points out, set the environment variables system wide so you don't need to cause emacs to use your .profile settings, or you can start emacs from the command line so that it gets the settings from .profile as in this answer: https://stackoverflow.com/a/13243093/90801 Starting it from the command line is nice because you can start several emacs's with different settings. or start them from a script:
FOO="BAR" /Applications/Emacs.app/Contents/MacOS/Emacs project.clj
would start emacs with foo having the value "BAR" without changing anything system wide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With