comparison lisp/env.el @ 584:4cd7543be581

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Mon, 16 Mar 1992 20:39:07 +0000
parents 3d2d0362a496
children 7cbd4fcd8b0f
comparison
equal deleted inserted replaced
583:3c0c1cd8428a 584:4cd7543be581
15 15
16 ;;; You should have received a copy of the GNU General Public License 16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Emacs; see the file COPYING. If not, write to 17 ;;; along with GNU Emacs; see the file COPYING. If not, write to
18 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 19
20 (provide 'setenv)
21
22 (defun setenv (variable value) 20 (defun setenv (variable value)
23 "Set the value of the environment variable named VARIABLE to VALUE. 21 "Set the value of the environment variable named VARIABLE to VALUE.
24 VARIABLE and VALUE should both be strings. 22 VARIABLE and VALUE should both be strings.
25 This function works by modifying process-environment." 23 This function works by modifying process-environment."
26 (if (string-match "=" variable) 24 (if (string-match "=" variable)
33 (setcar scan (concat variable "=" value)) 31 (setcar scan (concat variable "=" value))
34 (setq scan nil)) 32 (setq scan nil))
35 ((null (setq scan (cdr scan))) 33 ((null (setq scan (cdr scan)))
36 (setq process-environment 34 (setq process-environment
37 (cons (concat variable "=" value) process-environment)))))))) 35 (cons (concat variable "=" value) process-environment))))))))
36
37 (provide 'setenv)
38