From 05e38a42da74cbc2a7c203c92d0f9b78d76480c4 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Mon, 15 Mar 2004 15:39:21 +0000 Subject: [PATCH] Save and restore the current package for -le and -lel. --- scsh/top.scm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scsh/top.scm b/scsh/top.scm index 5fee133..b18c04c 100644 --- a/scsh/top.scm +++ b/scsh/top.scm @@ -247,8 +247,10 @@ ((string=? (car switch) "-le") ; (format #t "loading exec file ~s~%" (cdr switch)) - (load-quietly (cdr switch) (user-command-environment)) - (lp switches script-loaded?)) + (let ((current-package (interaction-environment))) + (load-quietly (cdr switch) (user-command-environment)) + (set-interaction-environment! current-package) + (lp switches script-loaded?))) ((string=? (car switch) "-ll") (load-library-file (cdr switch) (lib-dirs) script-file @@ -256,9 +258,11 @@ (lp switches script-loaded?)) ((string=? (car switch) "-lel") - (load-library-file (cdr switch) (lib-dirs) script-file - (user-command-environment)) - (lp switches script-loaded?)) + (let ((current-package (interaction-environment))) + (load-library-file (cdr switch) (lib-dirs) script-file + (user-command-environment)) + (set-interaction-environment! current-package) + (lp switches script-loaded?))) ((string=? (car switch) "+lp") (lib-dirs-prepend! (cdr switch))