diff options
| author | Dan Nicolaescu | 2007-07-03 04:53:21 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2007-07-03 04:53:21 +0000 |
| commit | de87fb5978903768aff3c71857ebca173461bea3 (patch) | |
| tree | a730da52bd15d248d83d5a897c462bc2c2b3a65b /lisp | |
| parent | 5f06b6081389843ba2d2d817683eb4e610f7a24e (diff) | |
| download | emacs-de87fb5978903768aff3c71857ebca173461bea3.tar.gz emacs-de87fb5978903768aff3c71857ebca173461bea3.zip | |
* server.el (server-process-filter): Likewise.
(server-process-filter): Likewise. Also set COLORFGBG and
COLORTERM.
* frame.el (frame-initialize, make-frame): Likewise.
* faces.el (tty-set-up-initial-frame-faces): Likewise.
* env.el (read-envvar-name): Don't consider the environment frame
param.
(setenv): Set display-environment-variable and
term-environment-variable.
* frame.c (Qterm_environment_variable,
Qdisplay_environment_variable): New variables.
(syms_of_frame): Intern and staticpro them.
* frame.h: Declare them here.
* callproc.c (child_setup): Use the display-environment-variable
and term-environment-variable frame params.
(getenv_internal): Likewise.
(set_initial_environment): Initialise Vprocess_environment.
* frames.texi (Basic Parameters): Add display-environment-variable
and term-environment-variable.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog.multi-tty | 13 | ||||
| -rw-r--r-- | lisp/env.el | 18 | ||||
| -rw-r--r-- | lisp/faces.el | 6 | ||||
| -rw-r--r-- | lisp/frame.el | 12 | ||||
| -rw-r--r-- | lisp/server.el | 13 |
5 files changed, 53 insertions, 9 deletions
diff --git a/lisp/ChangeLog.multi-tty b/lisp/ChangeLog.multi-tty index 6c04ee57077..cc115bb0278 100644 --- a/lisp/ChangeLog.multi-tty +++ b/lisp/ChangeLog.multi-tty | |||
| @@ -1,5 +1,18 @@ | |||
| 1 | 2007-07-02 Dan Nicolaescu <dann@ics.uci.edu> | 1 | 2007-07-02 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 2 | ||
| 3 | * server.el (server-process-filter): Likewise. | ||
| 4 | (server-process-filter): Likewise. Also set COLORFGBG and | ||
| 5 | COLORTERM. | ||
| 6 | |||
| 7 | * frame.el (frame-initialize, make-frame): Likewise. | ||
| 8 | |||
| 9 | * faces.el (tty-set-up-initial-frame-faces): Likewise. | ||
| 10 | |||
| 11 | * env.el (read-envvar-name): Don't consider the environment frame | ||
| 12 | param. | ||
| 13 | (setenv): Set display-environment-variable and | ||
| 14 | term-environment-variable. | ||
| 15 | |||
| 3 | * term/x-win.el (x-menu-bar-open): Use accelerate-menu. | 16 | * term/x-win.el (x-menu-bar-open): Use accelerate-menu. |
| 4 | 17 | ||
| 5 | 2007-06-23 Dan Nicolaescu <dann@ics.uci.edu> | 18 | 2007-06-23 Dan Nicolaescu <dann@ics.uci.edu> |
diff --git a/lisp/env.el b/lisp/env.el index a6626dc08ff..f2609cc6784 100644 --- a/lisp/env.el +++ b/lisp/env.el | |||
| @@ -55,7 +55,8 @@ If it is also not t, RET does not exit if it does non-null completion." | |||
| 55 | (substring enventry 0 | 55 | (substring enventry 0 |
| 56 | (string-match "=" enventry))))) | 56 | (string-match "=" enventry))))) |
| 57 | (append process-environment | 57 | (append process-environment |
| 58 | (frame-parameter (frame-with-environment) 'environment))) | 58 | nil ;;(frame-parameter (frame-with-environment) 'environment) |
| 59 | )) | ||
| 59 | nil mustmatch nil 'read-envvar-name-history)) | 60 | nil mustmatch nil 'read-envvar-name-history)) |
| 60 | 61 | ||
| 61 | ;; History list for VALUE argument to setenv. | 62 | ;; History list for VALUE argument to setenv. |
| @@ -191,9 +192,14 @@ a side-effect." | |||
| 191 | (setq process-environment (setenv-internal process-environment | 192 | (setq process-environment (setenv-internal process-environment |
| 192 | variable value t)) | 193 | variable value t)) |
| 193 | (setq frame (frame-with-environment frame)) | 194 | (setq frame (frame-with-environment frame)) |
| 194 | (set-frame-parameter frame 'environment | 195 | (cond |
| 195 | (setenv-internal (frame-parameter frame 'environment) | 196 | ((string-equal "TERM" variable) |
| 196 | variable value nil))) | 197 | (set-frame-parameter frame 'term-environment-variable value)) |
| 198 | ((string-equal "DISPLAY" variable) | ||
| 199 | (set-frame-parameter frame 'display-environment-variable value)) | ||
| 200 | (t | ||
| 201 | (setq process-environment (setenv-internal process-environment | ||
| 202 | variable value nil))))) | ||
| 197 | value) | 203 | value) |
| 198 | 204 | ||
| 199 | (defun getenv (variable &optional frame) | 205 | (defun getenv (variable &optional frame) |
| @@ -238,8 +244,8 @@ Non-ASCII characters are encoded according to the initial value of | |||
| 238 | `locale-coding-system', i.e. the elements must normally be decoded for use. | 244 | `locale-coding-system', i.e. the elements must normally be decoded for use. |
| 239 | See `setenv' and `getenv'." | 245 | See `setenv' and `getenv'." |
| 240 | (let* ((env (append process-environment | 246 | (let* ((env (append process-environment |
| 241 | (frame-parameter (frame-with-environment frame) | 247 | ;; (frame-parameter (frame-with-environment frame) |
| 242 | 'environment) | 248 | ;; 'environment) |
| 243 | nil)) | 249 | nil)) |
| 244 | (scan env) | 250 | (scan env) |
| 245 | prev seen) | 251 | prev seen) |
diff --git a/lisp/faces.el b/lisp/faces.el index 32d0c0af068..e5796272b0c 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1909,7 +1909,11 @@ terminal type to a different value." | |||
| 1909 | (defun tty-set-up-initial-frame-faces () | 1909 | (defun tty-set-up-initial-frame-faces () |
| 1910 | (let ((frame (selected-frame))) | 1910 | (let ((frame (selected-frame))) |
| 1911 | (frame-set-background-mode frame) | 1911 | (frame-set-background-mode frame) |
| 1912 | (face-set-after-frame-default frame))) | 1912 | (face-set-after-frame-default frame) |
| 1913 | (set-frame-parameter frame-initial-frame 'term-environment-variable | ||
| 1914 | (getenv "TERM")) | ||
| 1915 | (set-frame-parameter frame-initial-frame 'display-environment-variable | ||
| 1916 | (getenv "DISPLAY")))) | ||
| 1913 | 1917 | ||
| 1914 | 1918 | ||
| 1915 | 1919 | ||
diff --git a/lisp/frame.el b/lisp/frame.el index 5f32654fdb1..925b61ce754 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -241,6 +241,10 @@ Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args." | |||
| 241 | ;; Copy the environment of the Emacs process into the new frame. | 241 | ;; Copy the environment of the Emacs process into the new frame. |
| 242 | (set-frame-parameter frame-initial-frame 'environment | 242 | (set-frame-parameter frame-initial-frame 'environment |
| 243 | (frame-parameter terminal-frame 'environment)) | 243 | (frame-parameter terminal-frame 'environment)) |
| 244 | (set-frame-parameter frame-initial-frame 'term-environment-variable | ||
| 245 | (getenv "TERM")) | ||
| 246 | (set-frame-parameter frame-initial-frame 'display-environment-variable | ||
| 247 | (getenv "DISPLAY")) | ||
| 244 | ;; At this point, we know that we have a frame open, so we | 248 | ;; At this point, we know that we have a frame open, so we |
| 245 | ;; can delete the terminal frame. | 249 | ;; can delete the terminal frame. |
| 246 | (delete-frame terminal-frame) | 250 | (delete-frame terminal-frame) |
| @@ -700,11 +704,17 @@ setup is for focus to follow the pointer." | |||
| 700 | (normal-erase-is-backspace-setup-frame frame) | 704 | (normal-erase-is-backspace-setup-frame frame) |
| 701 | ;; Inherit the 'environment and 'client parameters. | 705 | ;; Inherit the 'environment and 'client parameters. |
| 702 | (let ((env (frame-parameter oldframe 'environment)) | 706 | (let ((env (frame-parameter oldframe 'environment)) |
| 703 | (client (frame-parameter oldframe 'client))) | 707 | (client (frame-parameter oldframe 'client)) |
| 708 | (termenv (frame-parameter oldframe 'term-environment-variable)) | ||
| 709 | (displayenv (frame-parameter oldframe 'display-environment-variable))) | ||
| 704 | (if (not (framep env)) | 710 | (if (not (framep env)) |
| 705 | (setq env oldframe)) | 711 | (setq env oldframe)) |
| 706 | (if (and env (not (assq 'environment parameters))) | 712 | (if (and env (not (assq 'environment parameters))) |
| 707 | (set-frame-parameter frame 'environment env)) | 713 | (set-frame-parameter frame 'environment env)) |
| 714 | (if (and termenv (not (assq 'term-environment-variable parameters))) | ||
| 715 | (set-frame-parameter frame 'term-environment-variable termenv)) | ||
| 716 | (if (and displayenv (not (assq 'display-environment-variable parameters))) | ||
| 717 | (set-frame-parameter frame 'display-environment-variable displayenv)) | ||
| 708 | (if (and client (not (assq 'client parameters))) | 718 | (if (and client (not (assq 'client parameters))) |
| 709 | (set-frame-parameter frame 'client client))) | 719 | (set-frame-parameter frame 'client client))) |
| 710 | (run-hook-with-args 'after-make-frame-functions frame) | 720 | (run-hook-with-args 'after-make-frame-functions frame) |
diff --git a/lisp/server.el b/lisp/server.el index 838aed96cf8..60ba66c88fe 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -763,6 +763,10 @@ The following commands are accepted by the client: | |||
| 763 | ;; initialization parameters for X frames at | 763 | ;; initialization parameters for X frames at |
| 764 | ;; the moment. | 764 | ;; the moment. |
| 765 | (modify-frame-parameters frame params) | 765 | (modify-frame-parameters frame params) |
| 766 | (set-frame-parameter frame 'display-environment-variable | ||
| 767 | (server-getenv-from env "DISPLAY")) | ||
| 768 | (set-frame-parameter frame 'term-environment-variable | ||
| 769 | (server-getenv-from env "TERM")) | ||
| 766 | (select-frame frame) | 770 | (select-frame frame) |
| 767 | (server-client-set client 'frame frame) | 771 | (server-client-set client 'frame frame) |
| 768 | (server-client-set client 'terminal (frame-terminal frame)) | 772 | (server-client-set client 'terminal (frame-terminal frame)) |
| @@ -812,12 +816,19 @@ The following commands are accepted by the client: | |||
| 812 | "BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES" | 816 | "BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES" |
| 813 | "NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING" | 817 | "NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING" |
| 814 | "NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO" | 818 | "NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO" |
| 815 | "TERMINFO_DIRS" "TERMPATH") | 819 | "TERMINFO_DIRS" "TERMPATH" |
| 820 | ;; rxvt wants these | ||
| 821 | "COLORFGBG" "COLORTERM") | ||
| 816 | (setq frame (make-frame-on-tty tty type | 822 | (setq frame (make-frame-on-tty tty type |
| 817 | ;; Ignore nowait here; we always need to clean | 823 | ;; Ignore nowait here; we always need to clean |
| 818 | ;; up opened ttys when the client dies. | 824 | ;; up opened ttys when the client dies. |
| 819 | `((client . ,proc) | 825 | `((client . ,proc) |
| 820 | (environment . ,env))))) | 826 | (environment . ,env))))) |
| 827 | |||
| 828 | (set-frame-parameter frame 'display-environment-variable | ||
| 829 | (server-getenv-from env "DISPLAY")) | ||
| 830 | (set-frame-parameter frame 'term-environment-variable | ||
| 831 | (server-getenv-from env "TERM")) | ||
| 821 | (select-frame frame) | 832 | (select-frame frame) |
| 822 | (server-client-set client 'frame frame) | 833 | (server-client-set client 'frame frame) |
| 823 | (server-client-set client 'tty (terminal-name frame)) | 834 | (server-client-set client 'tty (terminal-name frame)) |