Index: slime.el
===================================================================
RCS file: /project/slime/cvsroot/slime/slime.el,v
retrieving revision 1.950
diff -u -r1.950 slime.el
--- slime.el	23 Jul 2008 14:17:32 -0000	1.950
+++ slime.el	28 Jul 2008 15:12:58 -0000
@@ -1125,14 +1125,17 @@
                           (init 'slime-init-command)
                           name
                           (buffer "*inferior-lisp*")
-                          init-function)
+                          init-function
+                          program-environment)
   (let ((args (list :program program :program-args program-args :buffer buffer 
                     :coding-system coding-system :init init :name name
-                    :init-function init-function)))
+                    :init-function init-function
+                    :program-environment program-args)))
     (slime-check-coding-system coding-system)
     (when (slime-bytecode-stale-p)
       (slime-urge-bytecode-recompile))
-    (let ((proc (slime-maybe-start-lisp program program-args 
+    (let ((proc (slime-maybe-start-lisp program program-args
+                                        program-environment
                                         directory buffer)))
       (slime-inferior-connect proc args)
       (pop-to-buffer (process-buffer proc)))))
@@ -1240,16 +1243,19 @@
 
 ;;; Starting the inferior Lisp and loading Swank:
 
-(defun slime-maybe-start-lisp (program program-args directory buffer)
+(defun slime-maybe-start-lisp (program program-args program-environment
+                               directory buffer)
   "Return a new or existing inferior lisp process."
   (cond ((not (comint-check-proc buffer))
-         (slime-start-lisp program program-args directory buffer))
+         (slime-start-lisp program program-args program-environment
+                           directory buffer))
         ((slime-reinitialize-inferior-lisp-p program program-args buffer)
          (when-let (conn (find (get-buffer-process buffer) slime-net-processes 
                                :key #'slime-inferior-process))
            (slime-net-close conn))
          (get-buffer-process buffer))
         (t (slime-start-lisp program program-args
+                             program-environment
                              directory
                              (generate-new-buffer-name buffer)))))
 
@@ -1259,14 +1265,17 @@
          (equal (plist-get args :program-args) program-args)
          (not (y-or-n-p "Create an additional *inferior-lisp*? ")))))
 
-(defun slime-start-lisp (program program-args directory buffer)
+(defun slime-start-lisp (program program-args program-environment
+                         directory buffer)
   "Does the same as `inferior-lisp' but less ugly.
 Return the created process."
   (with-current-buffer (get-buffer-create buffer)
     (when directory
       (cd (expand-file-name directory)))
     (comint-mode)
-    (comint-exec (current-buffer) "inferior-lisp" program nil program-args)
+    (let ((process-environment
+           (append program-environment process-environment)))
+      (comint-exec (current-buffer) "inferior-lisp" program nil program-args))
     (lisp-mode-variables t)
     (let ((proc (get-buffer-process (current-buffer))))
       (slime-set-query-on-exit-flag proc)
@@ -3716,6 +3725,7 @@
          (buffer-window (get-buffer-window buffer))
          (new-proc (slime-start-lisp (plist-get args :program)
                                      (plist-get args :program-args)
+                                     (plist-get args :program-environment)
                                      nil
                                      buffer))
          (repl-buffer (slime-repl-buffer nil process))
