On Thu, Mar 26, 2015 at 02:57:40PM +0100, Alan Schmitt wrote: > On 2015-03-26 14:50, Bernd Haug <bernd.h...@xaidat.com> writes: > > I'm using this nice trick (passed to me by a colleague) that sets the > environment variables and path to be the same in zsh and emacs (launched > From the GUI). > > #+begin_src emacs-lisp > (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
You could also use the `exec-path-from-shell' package, which will set a specified list of variables (defaults to MANPATH, PATH) from the shell. rick