On 2015-10-27 17:06, "Cook, Malcolm" <m...@stowers.org> writes:

>> 
>  > John Kitchin <jkitc...@andrew.cmu.edu> writes:
>  > 
>  > > This reminds me that I think I have this problem unless I open Emacs 
> from a
>  > > command line.
>  > 
>  > Yup - this is one way of circumvent the problem: by starting emacs from
>  > the command line.
>
> And, just to chime in late in the conversation, if your emacs was installed as
> an mac application using, say, http://emacsformacosx.com/ then you can start
> it from the command line as:
>
>       open -a /Applications/path/to/emacs
>
> and get the environment variables you expect...

An alternative, that seems to be cross platform, is to populate
variables when emacs start. This is what I do here:

#+begin_src emacs-lisp
;; **** fetch env variables from zshrc
(let ((vars (split-string-and-unquote (shell-command-to-string ". ~/.zshrc; 
export") "\n")))
  (mapcar (lambda (X) (let ((var_val (split-string-and-unquote X "=")))
                        (setenv (car var_val) (cadr var_val)))) vars)
  (setq exec-path 
        (append
         (split-string-and-unquote (getenv "PATH") ":")
         exec-path)))
#+end_src

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated October 26, 2015, Mauna Loa Obs.): 398.51 ppm

Attachment: signature.asc
Description: PGP signature

Reply via email to