[comp.emacs] Environment variables

mly@PREP.AI.MIT.EDU (Richard Mlynarik) (10/08/87)

A recent message claimed that the inability to set environment variables
is a reason not to use emacs as a login shell.

There is code distributed in Emacs to do this.  Change your config.h
file to include "#define MAINTAIN_ENVIRONMENT" (obviously, this doesn't
work under VMS)

MAINTAIN_ENVIRONMENT isn't turned on by default because of RMS' personal
preferences.  It is, however, available for all of us who feel that it is
the `right thing.'  The features added are `(getenv t)' (returns alist
of all environment variables) and `(setenv var val)' (sets environment
variable for current Emacs job and all its inferiors)

For hacking the environment passed to an inferior process, the `env'
program in emacs/etc/env is often sufficient.  For an example of its
usage, see emacs/lisp/shell.el