Show
Ignore:
Timestamp:
05/03/06 18:06:44 (3 years ago)
Author:
miyoshi
Message:

Load emacs-to-svn into vendor/emacs-CVS_HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • vendor/emacs-CVS_HEAD/lisp/env.el

    r4035 r4071  
    9191;; Fixme: Should `process-environment' be recoded if LC_CTYPE &c is set? 
    9292 
    93 (defun setenv (variable &optional value unset substitute-env-vars) 
     93(defun setenv (variable &optional value substitute-env-vars) 
    9494  "Set the value of the environment variable named VARIABLE to VALUE. 
    9595VARIABLE should be a string.  VALUE is optional; if not provided or 
    96 nil, the environment variable VARIABLE will be removed.  UNSET 
    97 if non-nil means to remove VARIABLE from the environment. 
    98 SUBSTITUTE-ENV-VARS, if non-nil, means to substitute environment 
    99 variables in VALUE with `substitute-env-vars', where see. 
    100 Value is the new value if VARIABLE, or nil if removed from the 
    101 environment. 
     96nil, the environment variable VARIABLE will be removed. 
    10297 
    10398Interactively, a prefix argument means to unset the variable. 
     
    105100appears at the front of the history list when you type in the new value. 
    106101Interactively, always replace environment variables in the new value. 
     102 
     103SUBSTITUTE-ENV-VARS, if non-nil, means to substitute environment 
     104variables in VALUE with `substitute-env-vars', which see. 
     105This is normally used only for interactive calls. 
     106 
     107The return value is the new value of VARIABLE, or nil if 
     108it was removed from the environment. 
    107109 
    108110This function works by modifying `process-environment'. 
     
    112114  (interactive 
    113115   (if current-prefix-arg 
    114        (list (read-envvar-name "Clear environment variable: " 'exact) nil t
     116       (list (read-envvar-name "Clear environment variable: " 'exact) nil
    115117     (let* ((var (read-envvar-name "Set environment variable: " nil)) 
    116118            (value (getenv var))) 
     
    122124                                   nil nil nil 'setenv-history 
    123125                                   value) 
    124              nil 
    125126             t)))) 
    126127  (if (and (multibyte-string-p variable) locale-coding-system) 
     
    130131          (error "Can't encode `%s=%s' with `locale-coding-system'" 
    131132                 variable (or value ""))))) 
    132   (if unset 
    133       (setq value nil) 
    134     (if substitute-env-vars 
    135         (setq value (substitute-env-vars value)))) 
     133  (and value 
     134       substitute-env-vars 
     135       (setq value (substitute-env-vars value))) 
    136136  (if (multibyte-string-p variable) 
    137137      (setq variable (encode-coding-string variable locale-coding-system)))