From: jmadam (John M. Adams)

Subject: fi-subproc.el--fi:user-env-vars

Date: 2000-3-28 11:20

For various reasons, the command line isn't a very robust way to pass
input to a program started via rsh, particularly if you want to
compute the argument.  A while back I added the simple concept of
fi:user-env-vars to fi-subproc.el to allow users to specify
environment variables to be passed to lisp processes started with
fi:common-lisp.

Here's a patch, FWIW.

Index: fi-subproc.el
==================================================================
RCS file: /cerb/p1/develop/cvs/acl-eli/fi-subproc.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 fi-subproc.el
--- fi-subproc.el	2000/02/24 20:24:30	1.1.1.1
+++ fi-subproc.el	2000/02/24 20:43:03
@@ -20,7 +20,7 @@
 ;; file named COPYING.  Among other things, the copyright notice
 ;; and this notice must be preserved on all copies.
 
-;; $Id: fi-subproc.el,v 1.1.1.1 2000/02/24 20:24:30 jmadams Exp $
+;; $Id: fi-subproc.el,v 1.200.10.10 1998/07/16 16:47:44 layer Exp $
 
 ;; Low-level subprocess mode guts
 
@@ -85,6 +85,11 @@
   "*An alist containing the environment variables to pass to newly created
 subprocesses.")
 
+(defvar fi:user-env-vars nil
+  "For remote lisps, at least, the environment is by far the best way
+to send startup data from emacs.  Wherever the above was used, we will
+now append this.")
+
 (defvar fi:pop-to-sublisp-buffer-after-lisp-eval nil
   "*If non-nil, then go to the Lisp subprocess buffer after sending
 expressions to Lisp (via the functions which eval or compile the region, a
@@ -455,7 +460,7 @@
 	      (let ((start-lisp-after-failed-connection t)
 		    (i 0)
 		    (process nil))
-		(fi::set-environment fi:subprocess-env-vars)
+		(fi::set-environment (fi:compute-subprocess-env-vars))
 		(while
 		    (condition-case nil
 			(progn
@@ -958,7 +963,7 @@
 	  (if (and directory (file-exists-p directory))
 	      (setq default-directory directory))
 	  (if process (delete-process process))
-	  (fi::set-environment fi:subprocess-env-vars)
+	  (fi::set-environment (fi:compute-subprocess-env-vars))
 	  (let (
 		;;(process-connection-type nil) ;bug3033
 		)
@@ -1475,10 +1480,10 @@
 (defun fi::env-vars ()
   (concat (mapconcat '(lambda (x)
 		       (format "%s=%s" (car x) (eval (eval (cdr x)))))
-		     fi:subprocess-env-vars
+		     (fi:compute-subprocess-env-vars)
 		     " ")
 	  " export "
-	  (mapconcat '(lambda (x) (car x)) fi:subprocess-env-vars " ")
+	  (mapconcat '(lambda (x) (car x)) (fi:compute-subprocess-env-vars) " ")
 	  "; "))
 
 (defun fi::set-environment-use-setenv (valist)
@@ -1498,3 +1503,7 @@
       (if (boundp 'process-environment)
 	  (symbol-function 'fi::set-environment-use-process-environment)
 	(symbol-function 'fi::set-environment-use-setenv)))
+
+(defun fi:compute-subprocess-env-vars ()
+  "Use this instead of the value of fi:subprocess-env-vars."
+  (append fi:subprocess-env-vars fi:user-env-vars))

-- 
John M. Adams