From e742a202a8cdc1cb4712425e69d9335098fb1693 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 9 Jun 2013 00:48:42 +0200 Subject: racket: C-u C-c C-z on a submodule enters it --- scheme/racket/geiser/user.rkt | 12 ++++++++---- 1 file 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)])) -- cgit v1.2.3