Function: shell-copy-environment-variable
shell-copy-environment-variable is an interactive and byte-compiled
function defined in shell.el.gz.
Signature
(shell-copy-environment-variable VARIABLE)
Documentation
Copy the environment variable VARIABLE from the subshell to Emacs.
This command reads the value of the specified environment variable
in the shell, and sets the same environment variable in Emacs
(what getenv in Emacs would return) to that value.
That value will affect any new subprocesses that you subsequently start
from Emacs.
Probably introduced at or before Emacs version 20.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/shell.el.gz
(defun shell-copy-environment-variable (variable)
"Copy the environment variable VARIABLE from the subshell to Emacs.
This command reads the value of the specified environment variable
in the shell, and sets the same environment variable in Emacs
\(what `getenv' in Emacs would return) to that value.
That value will affect any new subprocesses that you subsequently start
from Emacs."
(interactive (list (read-envvar-name "\
Copy Shell environment variable to Emacs: ")))
(setenv variable (shell-snarf-envar variable)))