diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2006-04-19 16:23:46 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2006-04-19 16:23:46 +0000 |
commit | 447b0165acd09060977e05c843f81c0bee4aa4df (patch) | |
tree | 70cf2d254760a2cf68a10b67f8a3570c05fff9a5 /lisp/env.el | |
parent | 4c57cca724993ab1334cc5c0b35c22b06daee0c3 (diff) | |
parent | 0fea1d10293b4c6d35c1e55b68cd26e91445213c (diff) | |
download | emacs-447b0165acd09060977e05c843f81c0bee4aa4df.tar.gz |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-216
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-217
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-218
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-219
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-220
Improve tq.el.
* emacs@sv.gnu.org/emacs--devo--0--patch-221
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-222
Update from CVS: src/puresize.h (PURESIZE_RATIO): Reduce to 10/6.
* emacs@sv.gnu.org/emacs--devo--0--patch-223
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-224
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-225
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-226
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-227
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-228
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-229
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-230
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-231
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-232
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-233
Update from CVS: lisp/progmodes/python.el (python-mode): Fix typo.
* emacs@sv.gnu.org/gnus--rel--5.10--patch-84
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-85
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-86
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-550
Diffstat (limited to 'lisp/env.el')
-rw-r--r-- | lisp/env.el | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lisp/env.el b/lisp/env.el index 22a86f13f3d..66d505ee011 100644 --- a/lisp/env.el +++ b/lisp/env.el @@ -94,15 +94,10 @@ Use `$$' to insert a single dollar sign." ;; Fixme: Should the environment be recoded if LC_CTYPE &c is set? -(defun setenv (variable &optional value unset substitute-env-vars frame) +(defun setenv (variable &optional value substitute-env-vars frame) "Set the value of the environment variable named VARIABLE to VALUE. VARIABLE should be a string. VALUE is optional; if not provided or nil, the environment variable VARIABLE will be removed. -UNSET if non-nil means to remove VARIABLE from the environment. -SUBSTITUTE-ENV-VARS, if non-nil, means to substitute environment -variables in VALUE with `substitute-env-vars', where see. -Value is the new value if VARIABLE, or nil if removed from the -environment. Interactively, a prefix argument means to unset the variable, and otherwise the current value (if any) of the variable appears at @@ -116,6 +111,13 @@ modifying either `global-environment' or the environment belonging to the selected frame, depending on the value of `local-environment-variables'. +SUBSTITUTE-ENV-VARS, if non-nil, means to substitute environment +variables in VALUE with `substitute-env-vars', which see. +This is normally used only for interactive calls. + +The return value is the new value of VARIABLE, or nil if +it was removed from the environment. + If optional parameter FRAME is non-nil, then it should be a a frame. If the specified frame has its own set of environment variables, this function will modify VARIABLE in it. Note that @@ -127,7 +129,7 @@ As a special case, setting variable `TZ' calls `set-time-zone-rule' as a side-effect." (interactive (if current-prefix-arg - (list (read-envvar-name "Clear environment variable: " 'exact) nil t) + (list (read-envvar-name "Clear environment variable: " 'exact) nil) (let* ((var (read-envvar-name "Set environment variable: " nil)) (value (getenv var))) (when value @@ -137,7 +139,6 @@ a side-effect." (read-from-minibuffer (format "Set %s to value: " var) nil nil nil 'setenv-history value) - nil t)))) (if (and (multibyte-string-p variable) locale-coding-system) (let ((codings (find-coding-systems-string (concat variable value)))) @@ -145,10 +146,9 @@ a side-effect." (memq (coding-system-base locale-coding-system) codings)) (error "Can't encode `%s=%s' with `locale-coding-system'" variable (or value ""))))) - (if unset - (setq value nil) - (if substitute-env-vars - (setq value (substitute-env-vars value)))) + (and value + substitute-env-vars + (setq value (substitute-env-vars value))) (if (multibyte-string-p variable) (setq variable (encode-coding-string variable locale-coding-system))) (if (and value (multibyte-string-p value)) |