summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-05-15 13:42:41 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-05-15 13:42:41 +0200
commite56277b22d668b6b46222d89054cc4842a1c0239 (patch)
tree7e286398abe97415cd286e5adfec35798d486e98
parent6b108fd3183192088ce94110b74d757360a29702 (diff)
downloadgeiser-chez-e56277b22d668b6b46222d89054cc4842a1c0239.tar.gz
geiser-chez-e56277b22d668b6b46222d89054cc4842a1c0239.tar.bz2
PLT: Bug fix: correctly handle explicit module definitions.
-rw-r--r--elisp/geiser-plt.el2
-rw-r--r--scheme/plt/geiser/modules.ss18
2 files changed, 12 insertions, 8 deletions
diff --git a/elisp/geiser-plt.el b/elisp/geiser-plt.el
index 1db0ec9..16c0b96 100644
--- a/elisp/geiser-plt.el
+++ b/elisp/geiser-plt.el
@@ -86,7 +86,7 @@ This function uses `geiser-plt-init-file' if it exists."
`(dynamic-require ''geiser ',proc)))
(defconst geiser-plt--module-re
- "^(module +\\(([^)]+)\\)")
+ "^(module +\\([^ ]+\\)")
(defun geiser-plt--explicit-module ()
(save-excursion
diff --git a/scheme/plt/geiser/modules.ss b/scheme/plt/geiser/modules.ss
index a1094af..142cf1e 100644
--- a/scheme/plt/geiser/modules.ss
+++ b/scheme/plt/geiser/modules.ss
@@ -40,14 +40,18 @@
((absolute-path? spec) `(file ,spec))
(else spec)))
-(define (module-spec->namespace mod-spec)
- (letrec ((spec (ensure-module-spec mod-spec))
- (handler (lambda (e)
- (load-module spec)
- (enter! #f)
- (module->namespace spec))))
+(define (module-spec->namespace spec)
+ (let* ((spec (ensure-module-spec spec))
+ (contract-handler (lambda (e)
+ (load-module spec)
+ (enter! #f)
+ (module->namespace spec)))
+ (filesystem-handler (lambda (e)
+ (when (symbol? spec)
+ (module->namespace `',spec)))))
(if spec
- (with-handlers ((exn:fail:contract? handler))
+ (with-handlers ((exn:fail:contract? contract-handler)
+ (exn:fail:filesystem? filesystem-handler))
(module->namespace spec))
(current-namespace))))