diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2007-09-21 07:10:07 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2007-09-21 07:10:07 +0000 |
commit | e159b8694348bf7356f1a5d792eb5a9d0f27aebc (patch) | |
tree | 2865d84c8fd337b1c67af088ae58aa5a60c38fd7 /lisp/server.el | |
parent | a44d9b8b4c49a82dac6b27b24b0aa52290ba1906 (diff) | |
download | emacs-e159b8694348bf7356f1a5d792eb5a9d0f27aebc.tar.gz |
(server-getenv-from): Remove. Use getenv-internal instead.
(server-create-tty-frame): Don't set unused `tty' property.
Set `display' instead of display-environment-variable.
(server-create-window-system-frame): No display-environment-variable.
Diffstat (limited to 'lisp/server.el')
-rw-r--r-- | lisp/server.el | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/lisp/server.el b/lisp/server.el index f22d693ffaa..04da434f737 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -213,22 +213,6 @@ Initialized by `server-start'.") New clients have no properties." (add-to-list 'server-clients proc)) -(defun server-getenv-from (env variable) - "Get the value of VARIABLE in ENV. -VARIABLE should be a string. Value is nil if VARIABLE is -undefined in ENV. Otherwise, value is a string. - -ENV should be in the same format as `process-environment'." - (let (entry result) - (while (and env (null result)) - (setq entry (car env) - env (cdr env)) - (if (and (> (length entry) (length variable)) - (eq ?= (aref entry (length variable))) - (equal variable (substring entry 0 (length variable)))) - (setq result (substring entry (+ (length variable) 1))))) - result)) - (defmacro server-with-environment (env vars &rest body) "Evaluate BODY with environment variables VARS set to those in ENV. The environment variables are then restored to their previous values. @@ -240,7 +224,7 @@ ENV should be in the same format as `process-environment'." (value (make-symbol "value"))) `(let ((process-environment process-environment)) (dolist (,var ,vars) - (let ((,value (server-getenv-from ,env ,var))) + (let ((,value (getenv-internal ,var ,env))) (push (if (null ,value) ,var (concat ,var "=" ,value)) @@ -585,11 +569,12 @@ Server mode runs a process that accepts commands from the `((client . ,proc) (environment . ,(process-get proc 'env))))))) - (set-frame-parameter frame 'display-environment-variable - (server-getenv-from (process-get proc 'env) "DISPLAY")) + ;; ttys don't use the `display' parameter, but callproc.c does to set + ;; the DISPLAY environment on subprocesses. + (set-frame-parameter frame 'display + (getenv-internal "DISPLAY" (process-get proc 'env))) (select-frame frame) (process-put proc 'frame frame) - (process-put proc 'tty (terminal-name frame)) (process-put proc 'terminal (frame-terminal frame)) ;; Display *scratch* by default. @@ -601,7 +586,7 @@ Server mode runs a process that accepts commands from the frame)) (defun server-create-window-system-frame (display nowait proc) - (if (not (fboundp 'x-create-frame)) + (if (not (fboundp 'make-frame-on-display)) (progn ;; This emacs does not support X. (server-log "Window system unsupported" proc) @@ -626,8 +611,6 @@ Server mode runs a process that accepts commands from the ;; initialization parameters for X frames at ;; the moment. (modify-frame-parameters frame params) - (set-frame-parameter frame 'display-environment-variable - (server-getenv-from (process-get proc 'env) "DISPLAY")) (select-frame frame) (process-put proc 'frame frame) (process-put proc 'terminal (frame-terminal frame)) |