From 971440d67c1aabda86d34916acd61e6f8b6f3dc9 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sat, 26 Jul 2014 00:56:10 +0100 Subject: [PATCH] Use exec-path-from-shell package to setup exec-path and PATH --- init.el | 1 - packages.el | 5 +++++ runtimes/golang.el | 10 ---------- runtimes/nodejs.el | 5 +---- runtimes/ruby.el | 6 ------ 5 files changed, 6 insertions(+), 21 deletions(-) delete mode 100644 runtimes/golang.el diff --git a/init.el b/init.el index 30805e1..d579f87 100644 --- a/init.el +++ b/init.el @@ -31,7 +31,6 @@ ;; Load runtime specific setup files (load-file (get-config-path "runtimes/ruby.el")) (load-file (get-config-path "runtimes/nodejs.el")) -(load-file (get-config-path "runtimes/golang.el")) ;; Custom variables file (setq custom-file (get-config-path "custom-variables.el")) diff --git a/packages.el b/packages.el index 625c06b..c33dddc 100644 --- a/packages.el +++ b/packages.el @@ -36,6 +36,7 @@ dash-at-point dired+ ecb + exec-path-from-shell expand-region feature-mode fill-column-indicator @@ -170,6 +171,10 @@ (setq stack-trace-on-error t) ;; hack to fix a load-error (if window-system (ecb-activate))) + (when (require 'exec-path-from-shell) + (when (memq window-system '(mac ns)) + (exec-path-from-shell-initialize))) + ;; Load Auto-Complete (when (require 'auto-complete nil 'noerror) (require 'auto-complete-config) diff --git a/runtimes/golang.el b/runtimes/golang.el deleted file mode 100644 index 1201217..0000000 --- a/runtimes/golang.el +++ /dev/null @@ -1,10 +0,0 @@ -;; -;; Go setup -;; - -(setq my-gopath (file-truename "~/.go")) -(setq my-gopath-bin (concat my-gopath "/bin")) - -(setenv "GOPATH" my-gopath) -(setenv "PATH" (concat my-gopath-bin ":" (getenv "PATH"))) -(setq exec-path (cons my-gopath-bin exec-path)) diff --git a/runtimes/nodejs.el b/runtimes/nodejs.el index 5c20884..000bace 100644 --- a/runtimes/nodejs.el +++ b/runtimes/nodejs.el @@ -2,9 +2,6 @@ ;; Node.js setup ;; -(setq exec-path (cons "~/.nvm/v0.10.24/bin" exec-path)) -;; (setenv "PATH" (concat "~/.nvm/v0.10.24/bin:" (getenv "PATH"))) - - +;; nvm (when (require 'nvm nil 'noerror) (nvm-use "v0.10.24")) diff --git a/runtimes/ruby.el b/runtimes/ruby.el index 271e35b..49c1f09 100644 --- a/runtimes/ruby.el +++ b/runtimes/ruby.el @@ -3,11 +3,5 @@ ;; ;; rbenv -(setq exec-path (cons "~/.rbenv/bin" exec-path)) -(setq exec-path (cons "~/.rbenv/shims" exec-path)) - -(setenv "PATH" (concat "~/.rbenv/bin:" (getenv "PATH"))) -(setenv "PATH" (concat "~/.rbenv/shims:" (getenv "PATH"))) - ;; (when (require 'rbenv nil 'noerror) ;; (global-rbenv-mode))