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

Fixed environment variable handling during terminal initialization.

lisp/server.el (server-getenv): New inline function.

lisp/term/rxvt.el (rxvt-set-background-mode): Use server-getenv
instead of getenv.
lisp/term/x-win.el (x-initialize-window-system): Ditto.
lisp/term/xterm.el (xterm-rxvt-set-background-mode): Ditto.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-158
This commit is contained in:
Karoly Lorentey 2004-05-08 16:20:28 +00:00
parent 52f9ab73a1
commit 2cd1371d9b
5 changed files with 77 additions and 37 deletions

View file

@ -872,6 +872,25 @@ Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it."
(global-set-key "\C-x#" 'server-edit)
(defsubst server-getenv (variable &optional frame)
"Get the value of VARIABLE in the client environment of frame FRAME.
VARIABLE should be a string. Value is nil if VARIABLE is undefined in
the environment. Otherwise, value is a string.
If FRAME is an emacsclient frame, then the variable is looked up
in the environment of the emacsclient process; otherwise the
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)
(getenv variable)
(setq env (server-client-get (car clients) 'environment))
(if (null env)
(getenv variable)
(assq variable env)))))
(defun server-unload-hook ()
(server-start t)
(remove-hook 'delete-tty-after-functions 'server-handle-delete-tty)