From: Camille Bourgoin <monsieur.camille@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: PATH Variable
Date: Mon, 16 Jul 2007 08:39:19 +0200 [thread overview]
Message-ID: <87lkdgx36w.fsf@gmail.com> (raw)
In-Reply-To: m2ejj86h5p.fsf@gmail.com
Anupam Sengupta <anupamsg@gmail.com> writes:
>>>>>> "Srandby" == srandby <srandby@gmail.com> writes:
>
> Srandby> Hi: Would somebody please tell me how to change the PATH variable
> Srandby> used by Emacs? I want to use a shell command, but Emacs can't find
> Srandby> the command. I've tried a bunch of stuff, but so far nothing works.
>
> Try adding this code fragment in your .emacs file:
>
> (setenv "PATH"
> (concat (expand-file-name <<YOUR PATH HERE>>)
> path-separator (getenv "PATH")))
>
> You may want to make this a function and invoke it for each path-element you
> want to be accessible from within Emacs.
>
> E.g.,
>
> ;;; Define a function to setup additional path
> (defun my-add-path (path-element)
> "Add the specified path element to the Emacs PATH"
> (interactive "DEnter directory to be added to path: ")
> (if (file-directory-p path-element)
> (setenv "PATH"
> (concat (expand-file-name path-element)
> path-separator (getenv "PATH")))))
>
> and then:
>
> ;;; Set localized PATH for Emacs.
> ;;; Example only
> (if (fboundp 'my-add-path)
> (let ((my-paths (list
> "/opt/local/bin"
> "/usr/local/bin"
> "/usr/local/sbin"
> "/usr/local/mysql/bin"
> "~/bin")))
> (dolist (path-to-add my-paths (getenv "PATH"))
> (my-add-path path-to-add))))
>
> BTW, this needs the cl package for the `dolist', which is present in Emacs 22
> and /possibly/ on V21 as well. If not present in your Emacs version, just
> replace the `dolist' with an alternate looping mechanism.
>
> HTH,
> --
> Anupam
dolist is present in Emacs 21.
--
Camille "Mesmento" Bourgoin
jabber : mr.camille@im.apinc.org
web : http://jbbourgoin.free.fr
next prev parent reply other threads:[~2007-07-16 6:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-16 5:13 PATH Variable srandby
2007-07-16 5:39 ` Anupam Sengupta
2007-07-16 6:39 ` Camille Bourgoin [this message]
2007-07-16 14:17 ` srandby
2007-07-16 21:25 ` David Kastrup
2007-07-17 5:20 ` srandby
2007-07-17 6:39 ` Thien-Thi Nguyen
2007-07-16 14:19 ` srandby
2007-07-16 12:51 ` Daniel Jensen
-- strict thread matches above, loose matches on Subject: below --
2007-07-16 14:22 srandby
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lkdgx36w.fsf@gmail.com \
--to=monsieur.camille@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).