From 9d89a7d69cf1845486f6636ae6a73785603351d2 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Tue, 27 Nov 2001 18:29:12 +0000 Subject: [PATCH] Initialize session and user-environment correctly. --- scsh/scsh-package.scm | 2 ++ scsh/startup.scm | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/scsh/scsh-package.scm b/scsh/scsh-package.scm index 476a701..0a6a164 100644 --- a/scsh/scsh-package.scm +++ b/scsh/scsh-package.scm @@ -248,6 +248,8 @@ command-processor ; command-output filenames ; translate scheme-level-2-internal ; usual-resumer + package-commands-internal ;user-environment + environments ; with-interaction-environment scheme) (files startup) (optimize auto-integrate) diff --git a/scsh/startup.scm b/scsh/startup.scm index 97c9cbd..62d19e0 100644 --- a/scsh/startup.scm +++ b/scsh/startup.scm @@ -42,10 +42,20 @@ ;;; This is what we export to the user for his programs. (define (dump-scsh-program start filename) - (really-dump-scsh-program (lambda (args) - (init-scsh-vars #t) ; Do it quietly. - (start args)) - filename)) + (let ((context (user-context))) + (really-dump-scsh-program + (lambda (args) + (with-new-session context ; "Log in" user. + (current-input-port) (current-output-port) + args + #f + (lambda () + (with-interaction-environment + (user-environment) ; <-- from CONTEXT. + (lambda () + (init-scsh-vars #t) ; Do it quietly. + (start args)))))) + filename))) (define (scsh-stand-alone-resumer start)