help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: updating shell environment variables


From: Thien-Thi Nguyen
Subject: Re: updating shell environment variables
Date: 05 Nov 2004 18:07:01 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

"Dan Elliott" <dan_elliott_at_cox_dot_net@noSpam.org> writes:

> If I need to change a few environment variables, must I exit and
> restart emacs for these to take effect?  I typically run emacs with
> the -nw switch and then suspend emacs when I need to change
> env. variables.  Is there a better way?  Having to restart emacs is a
> major pain!

if the env vars are only for use in emacs (for the benefit of
subprocesses started from within emacs, or for substitution in a
buffer-list or in a `M-x find-file' command), you can try jamenv.el:

http://www.glug.org/people/ttn/software/ttn-pers-elisp/dist/
       lisp/low-stress/jamenv.el

(note: url split into two lines.)  to try it out, after loading
jamenv.el, create a buffer w/ contents, for example:

  ;; cancellare
  - PWD
  - OLDPWD
  - PAGER
  
  ;; impostare
  b               ~/build
  td              ~/build/tastiera-dura
  e               ~/build/emacs
  g               ~/build/hack/guile-core
  s               ~/local/src
  www             ~/public_html

then do `M-x jamenv-buffer' in that buffer.  you can verify things
are working by looking at the value of the `process-environment'
elisp variable.  you can save this buffer to a file and apply
`jamenv-from-file' to the filename on startup.  if the file
contents should change, simply re-invoke `jamenv-from-file'
manually to update emacs' notion of env vars.

(you are right.  IMHO, leaving emacs is both sick AND wrong! ;-)

thi


reply via email to

[Prev in Thread] Current Thread [Next in Thread]