Skip to content

Instantly share code, notes, and snippets.

@jclosure
Created October 29, 2014 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jclosure/42d19ae4d6ac9bfa7862 to your computer and use it in GitHub Desktop.
Save jclosure/42d19ae4d6ac9bfa7862 to your computer and use it in GitHub Desktop.
Set your emacs PATH to match shell PATH
;;ADD THIS TO INIT.EL
;; set the path as terminal path [http://lists.gnu.org/archive/html/help-gnu-emacs/2011-10/msg00237.html]
(setq explicit-bash-args (list "--login" "-i"))
;; fix the PATH variable for GUI [http://clojure-doc.org/articles/tutorials/emacs.html#osx]
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell
(shell-command-to-string "$SHELL -i -l -c 'echo $PATH'")))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(when window-system (set-exec-path-from-shell-PATH))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment