changeset 83139:8e6f20317d12

Fix background mode initialization on client tty frames (rep. by Dan Nicolaescu). lisp/server.el (server-process-filter): Add the client parameter to the initialization parameters of new frames. (server-getenv): Use the 'client frame parameter and not server-clients-with to get the client; server-getenv is called during frame initialization. (Dan Nicolaescu) git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-179
author Karoly Lorentey <lorentey@elte.hu>
date Thu, 27 May 2004 17:57:59 +0000
parents 85232760f917
children caa7581d3828
files lisp/server.el
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/server.el	Thu May 27 17:24:17 2004 +0000
+++ b/lisp/server.el	Thu May 27 17:57:59 2004 +0000
@@ -480,7 +480,11 @@
 			       (or display
 				   (frame-parameter nil 'display)
 				   (getenv "DISPLAY")
-				   (error "Please specify display"))))
+				   (error "Please specify display"))
+			       (list (cons 'client proc))))
+		  ;; XXX We need to ensure the client parameter is
+		  ;; really set because Emacs forgets initialization
+		  ;; parameters for X frames at the moment.
 		  (modify-frame-parameters frame (list (cons 'client proc)))
 		  (select-frame frame)
 		  (server-client-set client 'frame frame)
@@ -513,8 +517,7 @@
 		    (setq request (substring request (match-end 0)))
 		    (unless (server-client-get client 'version)
 		      (error "Protocol error; make sure you use the correct version of emacsclient"))
-		    (setq frame (make-frame-on-tty tty type))
-		    (modify-frame-parameters frame (list (cons 'client proc)))
+		    (setq frame (make-frame-on-tty tty type (list (cons 'client proc))))
 		    (select-frame frame)
 		    (server-client-set client 'frame frame)
 		    (server-client-set client 'tty (frame-tty-name frame))
@@ -891,10 +894,10 @@
 
 If FRAME is nil or missing, then the selected frame is used."
   (when (not frame) (setq frame (selected-frame)))
-  (let ((clients (server-clients-with 'frame frame)) env)
-    (if (null clients)
+  (let ((client (frame-parameter frame 'client)) env)
+    (if (null client)
 	(getenv variable)
-      (setq env (server-client-get (car clients) 'environment))
+      (setq env (server-client-get client 'environment))
       (if (null env)
 	  (getenv variable)
 	(cdr (assoc variable env))))))