aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-08-31 04:39:24 +0000
committerStefan Monnier2007-08-31 04:39:24 +0000
commit6b8e474c53700bb1d039abf8a563c042bde5e0ee (patch)
treef166a5c7c6687e031f99bd3c5be30ac54500f834
parent3b44dbc50ca405d93c8b4a11ede9573f23c240a2 (diff)
downloademacs-6b8e474c53700bb1d039abf8a563c042bde5e0ee.tar.gz
emacs-6b8e474c53700bb1d039abf8a563c042bde5e0ee.zip
(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.
-rw-r--r--src/ChangeLog16
-rw-r--r--src/callproc.c36
2 files changed, 27 insertions, 25 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3d0007814ff..956f191df02 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12007-08-31 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * callproc.c (Vinitial_environment): New variable.
4 (set_initial_environment): Initialize it.
5 (syms_of_callproc): Declare it.
6 (child_setup): Don't mess with TERM via Qterm_environment_variable; the
7 TERM under which a process runs is never related to the TERM in which
8 Emacs is running.
9
12007-08-29 Dan Nicolaescu <dann@ics.uci.edu> 102007-08-29 Dan Nicolaescu <dann@ics.uci.edu>
2 11
3 * config.in (HAVE_WINDOW_SYSTEM): Don't undef MULTI_KBOARD here... 12 * config.in (HAVE_WINDOW_SYSTEM): Don't undef MULTI_KBOARD here...
@@ -825,8 +834,7 @@
825 For consistency, run after_insert_file_functions iff something 834 For consistency, run after_insert_file_functions iff something
826 got inserted. Move signal_after_change and update_compositions 835 got inserted. Move signal_after_change and update_compositions
827 after code running after_insert_file_functions. Make sure that 836 after code running after_insert_file_functions. Make sure that
828 undo_list doesn't record intermediate steps of the decoding 837 undo_list doesn't record intermediate steps of the decoding process.
829 process.
830 838
8312007-08-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 8392007-08-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
832 840
@@ -1015,8 +1023,8 @@
10152007-07-17 Glenn Morris <rgm@gnu.org> 10232007-07-17 Glenn Morris <rgm@gnu.org>
1016 1024
1017 * abbrev.c (abbrev_check_chars): New function. 1025 * abbrev.c (abbrev_check_chars): New function.
1018 (Fdefine_global_abbrev, Fdefine_mode_abbrev): Call 1026 (Fdefine_global_abbrev, Fdefine_mode_abbrev):
1019 abbrev_check_chars to check abbrev characters are word 1027 Call abbrev_check_chars to check abbrev characters are word
1020 constituents. Doc fix. 1028 constituents. Doc fix.
1021 1029
10222007-07-17 Stefan Monnier <monnier@iro.umontreal.ca> 10302007-07-17 Stefan Monnier <monnier@iro.umontreal.ca>
diff --git a/src/callproc.c b/src/callproc.c
index 5bd4cee9cfa..66d11ff402c 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -113,7 +113,7 @@ Lisp_Object Vtemp_file_name_pattern;
113 113
114Lisp_Object Vshell_file_name; 114Lisp_Object Vshell_file_name;
115 115
116Lisp_Object Vprocess_environment; 116Lisp_Object Vprocess_environment, Vinitial_environment;
117 117
118#ifdef DOS_NT 118#ifdef DOS_NT
119Lisp_Object Qbuffer_file_type; 119Lisp_Object Qbuffer_file_type;
@@ -1330,7 +1330,6 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
1330 Lisp_Object local = selected_frame; /* get_frame_param (XFRAME (Fframe_with_environment (selected_frame)), */ 1330 Lisp_Object local = selected_frame; /* get_frame_param (XFRAME (Fframe_with_environment (selected_frame)), */
1331/* Qenvironment); */ 1331/* Qenvironment); */
1332 1332
1333 Lisp_Object term;
1334 Lisp_Object display; 1333 Lisp_Object display;
1335 1334
1336 new_length = 0; 1335 new_length = 0;
@@ -1347,33 +1346,19 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
1347 new_length++; 1346 new_length++;
1348#endif 1347#endif
1349 1348
1350 /* Add TERM and DISPLAY from the frame local values. */ 1349 /* Add DISPLAY from the frame local values. */
1351 term = get_frame_param (XFRAME (local), Qterm_environment_variable);
1352 if (! NILP (term))
1353 new_length++;
1354
1355 display = get_frame_param (XFRAME (local), Qdisplay_environment_variable); 1350 display = get_frame_param (XFRAME (local), Qdisplay_environment_variable);
1356 if (! NILP (display)) 1351 if (! NILP (display))
1357 new_length++; 1352 new_length++;
1358 1353
1359 /* new_length + 2 to include PWD and terminating 0. */ 1354 /* new_length + 2 to include PWD and terminating 0. */
1360 env = new_env = (char **) alloca ((new_length + 2) * sizeof (char *)); 1355 env = new_env = (char **) alloca ((new_length + 2) * sizeof (char *));
1361
1362 /* If we have a PWD envvar, pass one down, 1356 /* If we have a PWD envvar, pass one down,
1363 but with corrected value. */ 1357 but with corrected value. */
1364 if (egetenv ("PWD")) 1358 if (egetenv ("PWD"))
1365 *new_env++ = pwd_var; 1359 *new_env++ = pwd_var;
1366 1360
1367 if (! NILP (term)) 1361 if (STRINGP (display))
1368 {
1369 int vlen = strlen ("TERM=") + strlen (SDATA (term)) + 1;
1370 char *vdata = (char *) alloca (vlen);
1371 strcpy (vdata, "TERM=");
1372 strcat (vdata, SDATA (term));
1373 new_env = add_env (env, new_env, vdata);
1374 }
1375
1376 if (! NILP (display))
1377 { 1362 {
1378 int vlen = strlen ("DISPLAY=") + strlen (SDATA (display)) + 1; 1363 int vlen = strlen ("DISPLAY=") + strlen (SDATA (display)) + 1;
1379 char *vdata = (char *) alloca (vlen); 1364 char *vdata = (char *) alloca (vlen);
@@ -1387,8 +1372,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
1387 CONSP (tem) && STRINGP (XCAR (tem)); 1372 CONSP (tem) && STRINGP (XCAR (tem));
1388 tem = XCDR (tem)) 1373 tem = XCDR (tem))
1389 { 1374 {
1390 if ((strcmp (SDATA (XCAR (tem)), "TERM") != 0) 1375 if (strcmp (SDATA (XCAR (tem)), "DISPLAY") != 0)
1391 && (strcmp (SDATA (XCAR (tem)), "DISPLAY") != 0))
1392 new_env = add_env (env, new_env, SDATA (XCAR (tem))); 1376 new_env = add_env (env, new_env, SDATA (XCAR (tem)));
1393 } 1377 }
1394 1378
@@ -1539,7 +1523,8 @@ getenv_internal (var, varlen, value, valuelen, frame)
1539 Lisp_Object scan; 1523 Lisp_Object scan;
1540 Lisp_Object term; 1524 Lisp_Object term;
1541 Lisp_Object display; 1525 Lisp_Object display;
1542 1526
1527 /* FIXME: Code duplication. */
1543 1528
1544 if (NILP (frame)) 1529 if (NILP (frame))
1545 { 1530 {
@@ -1843,6 +1828,9 @@ set_initial_environment ()
1843 Vprocess_environment); 1828 Vprocess_environment);
1844 store_frame_param (SELECTED_FRAME(), Qenvironment, Vprocess_environment); 1829 store_frame_param (SELECTED_FRAME(), Qenvironment, Vprocess_environment);
1845 } 1830 }
1831 /* Ideally, the `copy' shouldn't be necessary, but it seems it's frequent
1832 to use `delete' and friends on process-environment. */
1833 Vinitial_environment = Fcopy_sequence (Vprocess_environment);
1846} 1834}
1847 1835
1848void 1836void
@@ -1901,6 +1889,12 @@ If this variable is nil, then Emacs is unable to use a shared directory. */);
1901This is used by `call-process-region'. */); 1889This is used by `call-process-region'. */);
1902 /* This variable is initialized in init_callproc. */ 1890 /* This variable is initialized in init_callproc. */
1903 1891
1892 DEFVAR_LISP ("initial-environment", &Vinitial_environment,
1893 doc: /* List of environment variables inherited from the parent process.
1894Each element should be a string of the form ENVVARNAME=VALUE.
1895The elements must normally be decoded (using `locale-coding-system') for use. */);
1896 Vinitial_environment = Qnil;
1897
1904 DEFVAR_LISP ("process-environment", &Vprocess_environment, 1898 DEFVAR_LISP ("process-environment", &Vprocess_environment,
1905 doc: /* List of overridden environment variables for subprocesses to inherit. 1899 doc: /* List of overridden environment variables for subprocesses to inherit.
1906Each element should be a string of the form ENVVARNAME=VALUE. 1900Each element should be a string of the form ENVVARNAME=VALUE.