summaryrefslogtreecommitdiff
path: root/scheme/guile/geiser
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-02-11 01:32:14 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-02-11 01:32:14 +0100
commitba13256d20ce53c7a35092ae2d23debe64c764a5 (patch)
treeed96722677274a3bac15a88569fe4281468ab7b7 /scheme/guile/geiser
parente48d59af292ca82e77733070cf3444ac2e0ba7df (diff)
downloadgeiser-guile-ba13256d20ce53c7a35092ae2d23debe64c764a5.tar.gz
geiser-guile-ba13256d20ce53c7a35092ae2d23debe64c764a5.tar.bz2
Compile file.
Diffstat (limited to 'scheme/guile/geiser')
-rw-r--r--scheme/guile/geiser/eval.scm11
1 files changed, 9 insertions, 2 deletions
diff --git a/scheme/guile/geiser/eval.scm b/scheme/guile/geiser/eval.scm
index 7d82f7d..b4c0ea0 100644
--- a/scheme/guile/geiser/eval.scm
+++ b/scheme/guile/geiser/eval.scm
@@ -62,8 +62,15 @@ SUBR, MSG and REST."
(cons 'msg (if msg (apply format (cons #f (cons msg margs))) '()))
(cons 'rest (or rest '())))))
-(define (comp-file path)
+(define (comp-file path . dest)
"Compile and load file, given its full @var{path}."
- (compile-file path))
+ (let ((dest (if (null? dest)
+ (dirname path)
+ (car dest)))
+ (current (getcwd)))
+ (dynamic-wind
+ (lambda () (chdir dest))
+ (lambda () (compile-file path))
+ (lambda () (chdir current)))))
;;; eval.scm ends here