On 14 Aug 2011, daniele g. wrote: > There was a misunderstanding. I don't want to set an enviromental > variable, I want to _read_ it. For example, I want set up my email > address for Gnus from $USER and $HOSTNAME values. I know I can use > getenv to read them, but I don't know how to use them in my dot-emacs. > > My aim is to unify my conf files making them picking as many values as > possible from the same place. Do you think of this? #+begin_src emacs-lisp (cond ((and (string= (getenv "USER") "johndoe") (string= (getenv "HOSTNAME") "bar")) (setq user-mail-address "johndow@bar.com") (require 'john)) ((and (string= (getenv "USER") "janedoe") (string= (getenv "HOSTNAME") "bar")) (setq user-mail-address "johndow@bar.com") (require 'jane)) (t (setq user-mail-address (concat (getenv "USER") "@" (getenv "HOSTNAME"))))) #+end_src emacs-lisp But note that $HOSTNAME is often not set. You can use `system-name' here. Michael