From f105f403d206f95bf534226abb99f14aa2f3052e Mon Sep 17 00:00:00 2001 From: Karoly Lorentey Date: Mon, 26 Dec 2005 02:14:10 +0000 Subject: Implement automatic terminal-local environment variables via `local-environment-variables'. * lisp/env.el (setenv, getenv): Add optional terminal parameter. Update docs. (setenv): Handle `local-environment-variables'. (read-envvar-name): Also allow (and complete) local environment variables on the current terminal. * src/callproc.c: Include frame.h and termhooks.h, for terminal parameters. (Qenvironment): New constant. (Vlocal_environment_variables): New variable. (syms_of_callproc): Register and initialize them. (child_setup): Handle Vlocal_environment_variables. (getenv_internal): Add terminal parameter. Handle Vlocal_environment_variables. (Fgetenv_internal): Add terminal parameter. * src/termhooks.h (get_terminal_param): Declare. * src/Makefile.in (callproc.o): Update dependencies. * mac/makefile.MPW (callproc.c.x): Update dependencies. * lisp/termdev.el (terminal-id): Make parameter optional. (terminal-getenv, terminal-setenv, with-terminal-environment): Disable functions. * lisp/mule-cmds.el (set-locale-environment): Convert `terminal-getenv' calls to `getenv'. * lisp/rxvt.el (rxvt-set-background-mode): Ditto. * lisp/x-win.el (x-initialize-window-system): Ditto. * lisp/xterm.el (terminal-init-xterm): Ditto. * lisp/server.el (server-process-filter): Fix reference to the 'display frame parameter. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-461 --- README.multi-tty | 54 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 22 deletions(-) (limited to 'README.multi-tty') diff --git a/README.multi-tty b/README.multi-tty index ebe064c2fc..de75aa6a10 100644 --- a/README.multi-tty +++ b/README.multi-tty @@ -401,28 +401,10 @@ is probably not very interesting for anyone else.) THINGS TO DO ------------ -** Implement automatic forwarding of client environment variables to - forked processes, as discussed on the multi-tty list. Terminal - parameters are now accessible in C code, so the biggest obstacle is - gone. The `getenv_internal' and `child_setup' functions in - callproc.c must be changed to support the following variable: - - terminal-local-environment-variables is a variable defined in ... - - Enable or disable terminal-local environment variables. - - If set to t, `getenv', `setenv' and subprocess creation - functions use the environment variables of the emacsclient - process that created the selected frame, ignoring - `process-environment'. - - If set to nil, Emacs uses `process-environment' and ignores - the client environment. - - Otherwise, `terminal-local-environment-variables' should be a - list of variable names (represented by Lisp strings) to look - up in the client environment. The rest will come from - `process-environment'. +** Trouble: `setenv' doesn't actually set environment variables in the + Emacs process. This defeats the purpose of the elaborate + `server-with-environment' magic around the `tgetent' call in + `init_tty'. D'oh. ** (Possibly) create hooks in struct device for creating frames on a specific terminal, and eliminate the hackish terminal-related frame @@ -1348,5 +1330,33 @@ DIARY OF CHANGES (Disabled in patch-450.) +-- Implement automatic forwarding of client environment variables to + forked processes, as discussed on the multi-tty list. Terminal + parameters are now accessible in C code, so the biggest obstacle is + gone. The `getenv_internal' and `child_setup' functions in + callproc.c must be changed to support the following variable: + + terminal-local-environment-variables is a variable defined in ... + + Enable or disable terminal-local environment variables. + + If set to t, `getenv', `setenv' and subprocess creation + functions use the environment variables of the emacsclient + process that created the selected frame, ignoring + `process-environment'. + + If set to nil, Emacs uses `process-environment' and ignores + the client environment. + + Otherwise, `terminal-local-environment-variables' should be a + list of variable names (represented by Lisp strings) to look + up in the client environment. The rest will come from + `process-environment'. + + (Implemented in patch-461; `terminal-getenv', `terminal-setenv' and + `with-terminal-environment' are now replaced by extensions to + `getenv' and `setenv', and the new `local-environment-variables' + facility. Yay!) + ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d -- cgit v1.2.3