all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: srandby <srandby@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: PATH Variable
Date: Mon, 16 Jul 2007 07:19:32 -0700	[thread overview]
Message-ID: <1184595572.941007.212460@n60g2000hse.googlegroups.com> (raw)
In-Reply-To: <m2ejj86h5p.fsf@gmail.com>

On Jul 16, 1:39 am, Anupam Sengupta <anupa...@gmail.com> wrote:
> >>>>> "Srandby" == srandby  <sran...@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

Thanks for the help, I've got it working now.

Scott Randby

  parent reply	other threads:[~2007-07-16 14:19 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
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 [this message]
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1184595572.941007.212460@n60g2000hse.googlegroups.com \
    --to=srandby@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.