In Emacs 25 GUI, 1. Shell process loads environment variables, 2. Python process, started by run-python, doesn't load environment variables.
Run Emacs terminal mode in iTem2: Both shell and python process load environment variables.
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
Under OSX, Emacs itself wont, by default, load the same environment as your user unless you either:
If all you're interested in, are the
MANPATH variables, one way to get good values for those, are with this code (snipped from my emacs init file):
(let ((path-helper (lambda (p pd) (with-temp-buffer (mapc (lambda (filename) (insert-file-contents filename) (goto-char (point-max)) (unless (bolp) (insert "\n"))) (cons p (directory-files pd t "[^.]"))) (let (res) (goto-char (point-min)) (while (< (point) (point-max)) (setq res (cons (buffer-substring (point) (progn (end-of-line) (point))) res)) (forward-char 1)) (nreverse res)))))) (setq exec-path (funcall path-helper "/etc/paths" "/etc/paths.d")) (setenv "PATH" (mapconcat #'identity exec-path ":")) (setenv "MANPATH" (mapconcat #'identity (funcall path-helper "/etc/manpaths" "/etc/manpaths.d") ":")))
But then, of course, you need to maintain the files
/etc/manpaths.d/*. In any case, in the default setup, your login shell on OS X uses those files to set these variables, with the help of the
path_helper utility, so this should be no great burden.