Mercurial > emacs
changeset 83796:e7303426ed25
(Vinitial_environment): New variable.
(set_initial_environment): Initialize it.
(syms_of_callproc): Declare it.
(child_setup): Don't mess with TERM via Qterm_environment_variable; the
TERM under which a process runs is never related to the TERM in which
Emacs is running.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 31 Aug 2007 04:39:24 +0000 |
parents | 5ebc9b06e580 |
children | f86e7a61b05e |
files | src/ChangeLog src/callproc.c |
diffstat | 2 files changed, 27 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Fri Aug 31 01:59:20 2007 +0000 +++ b/src/ChangeLog Fri Aug 31 04:39:24 2007 +0000 @@ -1,3 +1,12 @@ +2007-08-31 Stefan Monnier <monnier@iro.umontreal.ca> + + * callproc.c (Vinitial_environment): New variable. + (set_initial_environment): Initialize it. + (syms_of_callproc): Declare it. + (child_setup): Don't mess with TERM via Qterm_environment_variable; the + TERM under which a process runs is never related to the TERM in which + Emacs is running. + 2007-08-29 Dan Nicolaescu <dann@ics.uci.edu> * config.in (HAVE_WINDOW_SYSTEM): Don't undef MULTI_KBOARD here... @@ -825,8 +834,7 @@ For consistency, run after_insert_file_functions iff something got inserted. Move signal_after_change and update_compositions after code running after_insert_file_functions. Make sure that - undo_list doesn't record intermediate steps of the decoding - process. + undo_list doesn't record intermediate steps of the decoding process. 2007-08-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> @@ -1015,8 +1023,8 @@ 2007-07-17 Glenn Morris <rgm@gnu.org> * abbrev.c (abbrev_check_chars): New function. - (Fdefine_global_abbrev, Fdefine_mode_abbrev): Call - abbrev_check_chars to check abbrev characters are word + (Fdefine_global_abbrev, Fdefine_mode_abbrev): + Call abbrev_check_chars to check abbrev characters are word constituents. Doc fix. 2007-07-17 Stefan Monnier <monnier@iro.umontreal.ca>
--- a/src/callproc.c Fri Aug 31 01:59:20 2007 +0000 +++ b/src/callproc.c Fri Aug 31 04:39:24 2007 +0000 @@ -113,7 +113,7 @@ Lisp_Object Vshell_file_name; -Lisp_Object Vprocess_environment; +Lisp_Object Vprocess_environment, Vinitial_environment; #ifdef DOS_NT Lisp_Object Qbuffer_file_type; @@ -1330,7 +1330,6 @@ Lisp_Object local = selected_frame; /* get_frame_param (XFRAME (Fframe_with_environment (selected_frame)), */ /* Qenvironment); */ - Lisp_Object term; Lisp_Object display; new_length = 0; @@ -1347,33 +1346,19 @@ new_length++; #endif - /* Add TERM and DISPLAY from the frame local values. */ - term = get_frame_param (XFRAME (local), Qterm_environment_variable); - if (! NILP (term)) - new_length++; - + /* Add DISPLAY from the frame local values. */ display = get_frame_param (XFRAME (local), Qdisplay_environment_variable); if (! NILP (display)) new_length++; /* new_length + 2 to include PWD and terminating 0. */ env = new_env = (char **) alloca ((new_length + 2) * sizeof (char *)); - /* If we have a PWD envvar, pass one down, but with corrected value. */ if (egetenv ("PWD")) *new_env++ = pwd_var; - if (! NILP (term)) - { - int vlen = strlen ("TERM=") + strlen (SDATA (term)) + 1; - char *vdata = (char *) alloca (vlen); - strcpy (vdata, "TERM="); - strcat (vdata, SDATA (term)); - new_env = add_env (env, new_env, vdata); - } - - if (! NILP (display)) + if (STRINGP (display)) { int vlen = strlen ("DISPLAY=") + strlen (SDATA (display)) + 1; char *vdata = (char *) alloca (vlen); @@ -1387,8 +1372,7 @@ CONSP (tem) && STRINGP (XCAR (tem)); tem = XCDR (tem)) { - if ((strcmp (SDATA (XCAR (tem)), "TERM") != 0) - && (strcmp (SDATA (XCAR (tem)), "DISPLAY") != 0)) + if (strcmp (SDATA (XCAR (tem)), "DISPLAY") != 0) new_env = add_env (env, new_env, SDATA (XCAR (tem))); } @@ -1539,7 +1523,8 @@ Lisp_Object scan; Lisp_Object term; Lisp_Object display; - + + /* FIXME: Code duplication. */ if (NILP (frame)) { @@ -1843,6 +1828,9 @@ Vprocess_environment); store_frame_param (SELECTED_FRAME(), Qenvironment, Vprocess_environment); } + /* Ideally, the `copy' shouldn't be necessary, but it seems it's frequent + to use `delete' and friends on process-environment. */ + Vinitial_environment = Fcopy_sequence (Vprocess_environment); } void @@ -1901,6 +1889,12 @@ This is used by `call-process-region'. */); /* This variable is initialized in init_callproc. */ + DEFVAR_LISP ("initial-environment", &Vinitial_environment, + doc: /* List of environment variables inherited from the parent process. +Each element should be a string of the form ENVVARNAME=VALUE. +The elements must normally be decoded (using `locale-coding-system') for use. */); + Vinitial_environment = Qnil; + DEFVAR_LISP ("process-environment", &Vprocess_environment, doc: /* List of overridden environment variables for subprocesses to inherit. Each element should be a string of the form ENVVARNAME=VALUE.