diff lisp/server.el @ 83427:2afc49c9f0c0

Store local environment in frame (not terminal) parameters. * src/callproc.c (child_setup, getenv_internal, Fgetenv_internal): Store the local environment in a frame (not terminal) parameter. Update doc strings. (syms_of_callproc): Update doc strings. (Qenvironment): Moved to frame.c. * lisp/env.el (read-envvar-name, setenv, getenv, environment): Use frame parameters to store the local environment, not terminal parameters. * server.el (server-process-filter): Store the local environment in a frame (not terminal) parameter. Do not try to decode environment strings. * lisp/frame.el (make-frame): Set up the 'environment frame parameter, when needed. * src/frame.c (Qenvironment): Move here from callproc.c. (Fdelete_frame): Don't allow other frames to refer to a deleted frame in their 'environment parameter. (Fframe_with_environment): New function. (syms_of_frame): Defsubr it. Initialize and staticpro Qenvironment. * frame.h (Qenvironment): Declare. * lisp.h (Fframe_with_environment): EXFUN it. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-467
author Karoly Lorentey <lorentey@elte.hu>
date Thu, 29 Dec 2005 04:31:04 +0000
parents bb2edc915032
children 76396de7f50a
line wrap: on
line diff
--- a/lisp/server.el	Thu Dec 29 02:10:23 2005 +0000
+++ b/lisp/server.el	Thu Dec 29 04:31:04 2005 +0000
@@ -620,8 +620,8 @@
 					  ;; emacsclient quits while also preventing
 					  ;; `server-save-buffers-kill-display' from unexpectedly
 					  ;; killing emacs on that frame.
-					  (list (cons 'client 'nowait))
-					(list (cons 'client proc)))))
+					  (list (cons 'client 'nowait) (cons 'environment env))
+					(list (cons 'client proc) (cons 'environment env)))))
 			  (setq frame (make-frame-on-display
 				       (or display
 					   (frame-parameter nil 'display)
@@ -637,7 +637,6 @@
 			  (select-frame frame)
 			  (server-client-set client 'frame frame)
 			  (server-client-set client 'device (frame-display frame))
-			  (set-terminal-parameter frame 'environment env)
 			  (setq dontkill t))
 		      ;; This emacs does not support X.
 		      (server-log "Window system unsupported" proc)
@@ -684,12 +683,12 @@
 			(setq frame (make-frame-on-tty tty type
 						       ;; Ignore nowait here; we always need to clean
 						       ;; up opened ttys when the client dies.
-						       `((client . ,proc)))))
+						       `((client . ,proc)
+							 (environment . ,env)))))
 		      (select-frame frame)
 		      (server-client-set client 'frame frame)
 		      (server-client-set client 'tty (display-name frame))
 		      (server-client-set client 'device (frame-display frame))
-		      (set-terminal-parameter frame 'environment env)
 
 		      ;; Reply with our pid.
 		      (server-send-string proc (concat "-emacs-pid " (number-to-string (emacs-pid)) "\n"))
@@ -740,8 +739,7 @@
 		 ;; -env NAME=VALUE:  An environment variable.
 		 ((and (equal "-env" arg) (string-match "\\([^ ]+\\) " request))
 		  (let ((var (server-unquote-arg (match-string 1 request))))
-		    (when coding-system
-		      (setq var (decode-coding-string var coding-system)))
+		    ;; XXX Variables should be encoded as in getenv/setenv.
 		    (setq request (substring request (match-end 0)))
 		    (setq env (cons var env))))