summaryrefslogtreecommitdiff
path: root/scheme/racket/geiser/user.rkt
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2013-06-09 00:48:42 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-06-09 00:48:42 +0200
commite742a202a8cdc1cb4712425e69d9335098fb1693 (patch)
tree7a1c6af6a6b05cfbf2d682393602b20e38e7dc8d /scheme/racket/geiser/user.rkt
parentf7d7ec626066ca067db0e3bb9cc42f45ab1c5727 (diff)
downloadgeiser-guile-e742a202a8cdc1cb4712425e69d9335098fb1693.tar.gz
geiser-guile-e742a202a8cdc1cb4712425e69d9335098fb1693.tar.bz2
racket: C-u C-c C-z on a submodule enters it
Diffstat (limited to 'scheme/racket/geiser/user.rkt')
-rw-r--r--scheme/racket/geiser/user.rkt12
1 files changed, 8 insertions, 4 deletions
diff --git a/scheme/racket/geiser/user.rkt b/scheme/racket/geiser/user.rkt
index 96b6431..5ce003d 100644
--- a/scheme/racket/geiser/user.rkt
+++ b/scheme/racket/geiser/user.rkt
@@ -32,12 +32,19 @@
(current-namespace (module->namespace mod))
(last-entered name))
+(define (file-mod? mod)
+ (and (list? mod)
+ (= 2 (length mod))
+ (eq? 'file (car mod))
+ (path-string? (cadr mod))))
+
(define (submod-path mod)
(and (list? mod)
(eq? 'submod (car mod))
(> (length mod) 1)
(let ([parent (cadr mod)])
(cond [(path-string? parent) `(submod (file ,parent) ,@(cddr mod))]
+ [(file-mod? parent) mod]
[(symbol? parent) mod]
[else #f]))))
@@ -47,10 +54,7 @@
(last-entered "")]
[(symbol? mod) (do-enter mod (symbol->string mod))]
[(path-string? mod) (do-enter `(file ,mod) mod)]
- [(and (list? mod)
- (= 2 (length mod))
- (eq? 'file (car mod))
- (path-string? (cadr mod))) (do-enter mod (cadr mod))]
+ [(file-mod? mod) (do-enter mod (cadr mod))]
[(submod-path mod) => (lambda (m) (do-enter m m))]
[else (raise-syntax-error #f "Invalid module path" stx mod)]))