From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike McLean Subject: Re: Org-Mode and Mac OS X advice Date: Mon, 30 Mar 2015 06:31:49 -0400 Message-ID: References: <20150328162632.GA71345@eyeBook.home> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff2521a9654c105127efe81 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcWzT-0006mm-TX for emacs-orgmode@gnu.org; Mon, 30 Mar 2015 06:32:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcWzQ-0005qP-LW for emacs-orgmode@gnu.org; Mon, 30 Mar 2015 06:32:19 -0400 Received: from pb-sasl1.int.icgroup.com ([208.72.237.25]:62059 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcWzQ-0005q9-Ej for emacs-orgmode@gnu.org; Mon, 30 Mar 2015 06:32:16 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 1A8A439E1B for ; Mon, 30 Mar 2015 06:32:11 -0400 (EDT) Received: from pb-sasl1.int.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 11BAA39E19 for ; Mon, 30 Mar 2015 06:32:11 -0400 (EDT) Received: from mail-oi0-f43.google.com (unknown [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id 96E6539E13 for ; Mon, 30 Mar 2015 06:32:10 -0400 (EDT) Received: by oifl3 with SMTP id l3so124383033oif.0 for ; Mon, 30 Mar 2015 03:32:10 -0700 (PDT) In-Reply-To: <20150328162632.GA71345@eyeBook.home> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt , Bernd Haug , emacs-orgmode , chris@meliser.co.uk --e89a8ff2521a9654c105127efe81 Content-Type: text/plain; charset=UTF-8 On Sat, Mar 28, 2015 at 12:26 PM, Rick Frankel wrote: > On Thu, Mar 26, 2015 at 02:57:40PM +0100, Alan Schmitt wrote: > > On 2015-03-26 14:50, Bernd Haug writes: > > > > I'm using this nice trick (passed to me by a colleague) that sets the > > environment variables and path to be the same in zsh and emacs (launched > > From the GUI). > > > > #+begin_src emacs-lisp > > (let ((vars (split-string-and-unquote (shell-command-to-string ". > ~/.zshrc; export") "\n"))) > > (mapcar (lambda (X) (let ((var_val (split-string-and-unquote X "="))) > > (setenv (car var_val) (cadr var_val)))) vars) > > (setq exec-path > > (append > > (split-string-and-unquote (getenv "PATH") ":") > > exec-path))) > > #+end_src > > You could also use the `exec-path-from-shell' package, which will set a > specified list of variables (defaults to MANPATH, PATH) from the shell. > Which is the way I do it also. I have the following in my emacs-init.org file (that Tangles to my actual Emacs init file) #+begin_src emacs-lisp :tangle yes (add-to-list 'el-get-sources '(:name exec-path-from-shell)) (let ((exec-path-from-shell.el "~/.emacs.d/el-get/exec-path-from-shell/exec-path-from-shell.el")) (when (file-exists-p exec-path-from-shell.el) (load exec-path-from-shell.el) (require 'exec-path-from-shell) (when (memq window-system '(mac ns)) (exec-path-from-shell-initialize)))) #+end_src > rick > > --e89a8ff2521a9654c105127efe81 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Sat, Mar 28, 2015 at 12:26 PM, Rick Frankel <rick@rickster.com><= /span> wrote:
On Thu, Mar 26, 2015 at 02:57:40PM = +0100, Alan Schmitt wrote:
> On 2015-03-26 14:50, Bernd Haug <bernd.haug@xaidat.com> writes:
>
> I'm using this nice trick (passed to me by a colleagu= e) that sets the
> environment variables and path to be the same in zsh and emacs (launch= ed
> From the GUI).
>
> #+begin_src emacs-lisp
> (let ((vars (split-string-and-unquote (shell-command-to-string ".= ~/.zshrc; export") "\n")))
>=C2=A0 =C2=A0(mapcar (lambda (X) (let ((var_val (split-string-and-unquo= te X "=3D")))
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(setenv (car var_val) (cadr var_val)))) vars)
>=C2=A0 =C2=A0(setq exec-path
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(append
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (split-string-and-unquote (getenv &q= uot;PATH") ":")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exec-path)))
> #+end_src

You could also use the `exec-path-from-shell' package, which wil= l set a
specified list of variables (defaults to MANPATH, PATH) from the shell.

Which is the way I do it also. I have the following in my emacs-init.org file (that Tangles = to my actual Emacs init file)

#+begin_src ema= cs-lisp :tangle yes
=C2=A0 (add-to-list 'el-get-sources '= (:name exec-path-from-shell))
=C2=A0 (let ((exec-path-from-shell.= el "~/.emacs.d/el-get/exec-path-from-shell/exec-path-from-shell.el&quo= t;))
=C2=A0 =C2=A0 (when (file-exists-p exec-path-from-shell.el)<= /div>
=C2=A0 =C2=A0 =C2=A0 (load exec-path-from-shell.el)
=C2= =A0 =C2=A0 =C2=A0 (require 'exec-path-from-shell)
=C2=A0 =C2= =A0 =C2=A0 (when (memq window-system '(mac ns))
=C2=A0 =C2=A0= =C2=A0 =C2=A0 (exec-path-from-shell-initialize))))
#+end_src



=C2=A0
rick


--e89a8ff2521a9654c105127efe81--