{"id":15,"date":"2014-03-16T12:54:00","date_gmt":"2014-03-16T12:54:00","guid":{"rendered":""},"modified":"2016-02-25T18:09:01","modified_gmt":"2016-02-25T18:09:01","slug":"getting-emacs-for-mac-os-x-to-honour-the-shell-environment","status":"publish","type":"post","link":"https:\/\/www.root42.de\/blog\/?p=15","title":{"rendered":"Getting Emacs for Mac OS X to honour the shell environment"},"content":{"rendered":"<p>If your are using the excellent <a href=\"http:\/\/emacsformacosx.com\/\">Emacs for Mac OS X<\/a> distribution, you may have noticed that it does not use the environment you may have defined in your ~\/.bashrc. This can be a problem if you are using <a href=\"http:\/\/www.macports.org\/\">MacPorts<\/a>, for example to install <a href=\"http:\/\/clojure.org\/\">clojure<\/a> and <a href=\"http:\/\/leiningen.org\/\">Leiningen<\/a>. You will get an error message like this, when trying to run inferior-lisp in clojure-mode:<\/p>\n<p><span style=\"font-family: Courier New, Courier, monospace;\">apply: Searching for program: No such file or directory, lein <\/span><\/p>\n<div>This can be avoided by using the excellent <a href=\"https:\/\/github.com\/purcell\/exec-path-from-shell\">exec-path-from-shell<\/a> package for Emacs. It is available via (<a href=\"http:\/\/melpa.milkbox.net\/#\/\">M<\/a>)<a href=\"http:\/\/elpa.gnu.org\/\">ELPA<\/a>, just install it using list-packages, or download it from <a href=\"https:\/\/github.com\/purcell\/exec-path-from-shell\">github<\/a>. You can enable it, especially for OS X, by putting this in your init.el:<\/div>\n<div><\/div>\n<pre>(when (memq window-system '(mac ns))<br \/>    (exec-path-from-shell-initialize))<br \/><br \/><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If your are using the excellent Emacs for Mac OS X distribution, you may have noticed that it does not use the environment you may have defined in your ~\/.bashrc. This can be a problem if you are using MacPorts, for example to install clojure and Leiningen. You will get an error message like this, &hellip; <a href=\"https:\/\/www.root42.de\/blog\/?p=15\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Getting Emacs for Mac OS X to honour the shell environment&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,6,5,10],"tags":[],"_links":{"self":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/15"}],"collection":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=15"}],"version-history":[{"count":1,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions"}],"predecessor-version":[{"id":199,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/15\/revisions\/199"}],"wp:attachment":[{"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=15"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=15"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.root42.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=15"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}