Created
December 10, 2015 05:20
-
-
Save robdaemon/0ef7ea7614cfbce945bd to your computer and use it in GitHub Desktop.
Fix the path on emacs on Mac
This file contains hidden or 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
| ;; fix the PATH variable | |
| (defun set-exec-path-from-shell-PATH () | |
| (let ((path-from-shell (shell-command-to-string "$SHELL -i -c 'echo -n $PATH'"))) | |
| (setenv "PATH" path-from-shell) | |
| (setq exec-path (split-string path-from-shell path-separator)))) | |
| (defun set-env-from-shell (envvar) | |
| (let ((path-from-shell (shell-command-to-string (format "$SHELL -i -c 'echo -n $%s'" envvar)))) | |
| (setenv envvar path-from-shell))) | |
| (if window-system | |
| (progn | |
| (set-exec-path-from-shell-PATH) | |
| (set-env-from-shell "GOPATH") | |
| (set-env-from-shell "GOROOT"))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment