Mercurial > emacs
comparison lisp/env.el @ 8002:f8c8bbeca971
(setenv): Do something even if process-environment is nil.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 22 Jun 1994 04:07:38 +0000 |
parents | f4a7ac2ec651 |
children | a86eceda6537 |
comparison
equal
deleted
inserted
replaced
8001:1a6bff2bc0e7 | 8002:f8c8bbeca971 |
---|---|
40 (if (string-match "=" variable) | 40 (if (string-match "=" variable) |
41 (error "Environment variable name `%s' contains `='" variable) | 41 (error "Environment variable name `%s' contains `='" variable) |
42 (let ((pattern (concat "\\`" (regexp-quote (concat variable "=")))) | 42 (let ((pattern (concat "\\`" (regexp-quote (concat variable "=")))) |
43 (case-fold-search nil) | 43 (case-fold-search nil) |
44 (scan process-environment)) | 44 (scan process-environment)) |
45 (while scan | 45 (if scan |
46 (cond | 46 (while scan |
47 ((string-match pattern (car scan)) | 47 (cond |
48 (if (eq nil value) | 48 ((string-match pattern (car scan)) |
49 (setq process-environment (delq (car scan) process-environment)) | 49 (if (eq nil value) |
50 (setcar scan (concat variable "=" value))) | 50 (setq process-environment (delq (car scan) process-environment)) |
51 (setq scan nil)) | 51 (setcar scan (concat variable "=" value))) |
52 ((null (setq scan (cdr scan))) | 52 (setq scan nil)) |
53 (setq process-environment | 53 ((null (setq scan (cdr scan))) |
54 (cons (concat variable "=" value) process-environment)))))))) | 54 (setq process-environment |
55 (cons (concat variable "=" value) process-environment))))) | |
56 (setq process-environment | |
57 (cons (concat variable "=" value) process-environment)))))) | |
55 | 58 |
56 (provide 'env) | 59 (provide 'env) |
57 | 60 |
58 ;;; env.el ends here | 61 ;;; env.el ends here |