Mercurial > emacs
comparison lisp/eshell/esh-var.el @ 45098:06120f91eb06
(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'.
author | John Wiegley <johnw@newartisans.com> |
---|---|
date | Fri, 03 May 2002 20:43:53 +0000 |
parents | fc8297bd646c |
children | 59510270b3ea |
comparison
equal
deleted
inserted
replaced
45097:b71c3c733b9a | 45098:06120f91eb06 |
---|---|
132 :type 'boolean | 132 :type 'boolean |
133 :group 'eshell-var) | 133 :group 'eshell-var) |
134 | 134 |
135 (defcustom eshell-complete-export-definition t | 135 (defcustom eshell-complete-export-definition t |
136 "*If non-nil, completing names for `export' shows current definition." | 136 "*If non-nil, completing names for `export' shows current definition." |
137 :type 'boolean | |
138 :group 'eshell-var) | |
139 | |
140 (defcustom eshell-modify-global-environment nil | |
141 "*If non-nil, using `export' changes Emacs's global environment." | |
137 :type 'boolean | 142 :type 'boolean |
138 :group 'eshell-var) | 143 :group 'eshell-var) |
139 | 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. |
197 | 202 |
198 (defun eshell-var-initialize () | 203 (defun eshell-var-initialize () |
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 |
206 (set (make-local-variable 'eshell-special-chars-inside-quoting) | 213 (set (make-local-variable 'eshell-special-chars-inside-quoting) |
207 (append eshell-special-chars-inside-quoting '(?$))) | 214 (append eshell-special-chars-inside-quoting '(?$))) |