1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

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
This commit is contained in:
Karoly Lorentey 2004-05-27 17:57:59 +00:00
parent 4e1bb54039
commit 3a2584741d

View file

@ -480,7 +480,11 @@ PROC is the server process. Format of STRING is \"PATH PATH PATH... \\n\"."
(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 @@ PROC is the server process. Format of STRING is \"PATH PATH PATH... \\n\"."
(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 @@ function consults the environment of the Emacs process.
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))))))