diff options
| author | John Wiegley | 2002-05-03 20:43:53 +0000 |
|---|---|---|
| committer | John Wiegley | 2002-05-03 20:43:53 +0000 |
| commit | 6995786da57d027f2ae4490ff14e50f57d36659b (patch) | |
| tree | 16ea84ba95ea5ad017da9419709270a8822a6c68 | |
| parent | 3399c752794a5c872d733fedb53d865f3c4ca268 (diff) | |
| download | emacs-6995786da57d027f2ae4490ff14e50f57d36659b.tar.gz emacs-6995786da57d027f2ae4490ff14e50f57d36659b.zip | |
(eshell-modify-global-environment): Added this customization variable,
which will cause any "export" commands within any eshell buffer to
modify the global Emacs environment. It defaults to nil, which means
that such commands will only modify that Eshell buffer's environment.
(eshell-var-initialize): Initialize `eshell-modify-global-environment'.
| -rw-r--r-- | lisp/eshell/esh-var.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el index e47ba5e0809..f447bfb0339 100644 --- a/lisp/eshell/esh-var.el +++ b/lisp/eshell/esh-var.el | |||
| @@ -137,6 +137,11 @@ variable value, a subcommand, or even the result of a Lisp form." | |||
| 137 | :type 'boolean | 137 | :type 'boolean |
| 138 | :group 'eshell-var) | 138 | :group 'eshell-var) |
| 139 | 139 | ||
| 140 | (defcustom eshell-modify-global-environment nil | ||
| 141 | "*If non-nil, using `export' changes Emacs's global environment." | ||
| 142 | :type 'boolean | ||
| 143 | :group 'eshell-var) | ||
| 144 | |||
| 140 | (defcustom eshell-variable-name-regexp "[A-Za-z0-9_-]+" | 145 | (defcustom eshell-variable-name-regexp "[A-Za-z0-9_-]+" |
| 141 | "*A regexp identifying what constitutes a variable name reference. | 146 | "*A regexp identifying what constitutes a variable name reference. |
| 142 | Note that this only applies for '$NAME'. If the syntax '$<NAME>' is | 147 | Note that this only applies for '$NAME'. If the syntax '$<NAME>' is |
| @@ -199,7 +204,9 @@ function), and the arguments passed to this function would be the list | |||
| 199 | "Initialize the variable handle code." | 204 | "Initialize the variable handle code." |
| 200 | ;; Break the association with our parent's environment. Otherwise, | 205 | ;; Break the association with our parent's environment. Otherwise, |
| 201 | ;; changing a variable will affect all of Emacs. | 206 | ;; changing a variable will affect all of Emacs. |
| 202 | (set (make-local-variable 'process-environment) (eshell-copy-environment)) | 207 | (unless eshell-modify-global-environment |
| 208 | (set (make-local-variable 'process-environment) | ||
| 209 | (eshell-copy-environment))) | ||
| 203 | 210 | ||
| 204 | (define-key eshell-command-map [(meta ?v)] 'eshell-insert-envvar) | 211 | (define-key eshell-command-map [(meta ?v)] 'eshell-insert-envvar) |
| 205 | 212 | ||