Created
October 29, 2014 02:17
-
-
Save jclosure/42d19ae4d6ac9bfa7862 to your computer and use it in GitHub Desktop.
Set your emacs PATH to match shell PATH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;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