john@crcaus.cactus.org (John R. Miller) (07/19/90)
Is there a version of getenv that accepts a process argument in addition to the environment variable? I want to do something like: (setq build-envar (getenv "ENVAR" (get-process "build"))) (getenv "ENVAR") returns the value in emacs' parent shell (or something like that -- anyway, it's not what I need). Thanks -- John R. Miller 512/331-0155 13102 Briar Hollow Dr. john@crcaus.cactus.org Austin, Texas 78729 ...cs.utexas.edu!bigtex!crcaus!john
jbw@zeb.uswest.com (Joe Wells) (07/21/90)
In article <281@crcaus.cactus.org> john@crcaus.cactus.org (John R. Miller) writes:
Is there a version of getenv that accepts a process argument in
addition to the environment variable? I want to do something like:
(setq build-envar (getenv "ENVAR" (get-process "build")))
(getenv "ENVAR") returns the value in emacs' parent shell (or something
like that -- anyway, it's not what I need).
Not under any version of Unix with which I'm familiar. Support for
something similar to this exists in Mach.
The problem has to do with how environment variables are implemented.
--
Joe Wells <jbw@uswest.com>
mleisher@nmsu.edu (Mark Leisher) (07/21/90)
When Gemacs starts a process, it runs a program called 'env'. This creates an environment for the process and executes the process program. The code for 'env' is in the etc/ subdirectory of the gemacs source code and 'shell.el' is in the lisp/ subdirectory. I would think that if you wanted the value of an environment varible in the processes environment, you would either have to make the program being run return the value, or, if you can't modifiy the program, you might want to do something like write a short program that returns the value of the environment variable and executes the actual program you want to run. -- ----------------------------------------------------------------------------- mleisher@nmsu.edu "I laughed. Mark Leisher I cried. Computing Research Lab I fell down. New Mexico State University It changed my life." Las Cruces, NM - Rich [Cowboy Feng's Space Bar and Grille]