diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-23 01:58:33 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-23 01:58:33 +0100 |
commit | 3b24e917fdfebc8df3fefbbcc747963eb4bbd126 (patch) | |
tree | a44d5f0cb47639d47bdb57f2233b2db5e5a878b7 /scheme/racket/geiser/modules.rkt | |
parent | a53249b83cdc0711f23b1b8860cd3582977230c6 (diff) | |
download | geiser-guile-3b24e917fdfebc8df3fefbbcc747963eb4bbd126.tar.gz geiser-guile-3b24e917fdfebc8df3fefbbcc747963eb4bbd126.tar.bz2 |
Document browser improvements, and Racket using them
We have a new "manual lookup" command, and Racket now displays a doc
browser buffer for help with a button activating it. In the process,
we've cleaned-up a little mess in geiser-eval.el and geiser-doc.el,
and refactored the affected Racket modules.
Next in line is providing manual lookup for Guile.
Diffstat (limited to 'scheme/racket/geiser/modules.rkt')
-rw-r--r-- | scheme/racket/geiser/modules.rkt | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/scheme/racket/geiser/modules.rkt b/scheme/racket/geiser/modules.rkt index 02fd460..eac3a6c 100644 --- a/scheme/racket/geiser/modules.rkt +++ b/scheme/racket/geiser/modules.rkt @@ -18,10 +18,14 @@ namespace->module-path-name module-path-name->name module-spec->path-name + module-identifiers module-list submodules) -(require srfi/13 geiser/enter) +(require srfi/13 + syntax/modcode + syntax/modresolve + geiser/enter) (define (ensure-module-spec spec) (cond [(symbol? spec) spec] @@ -48,7 +52,7 @@ (define (namespace->module-path-name ns) (let ([rmp (variable-reference->resolved-module-path - (eval '(#%variable-reference) ns))]) + (eval '(#%variable-reference) (or ns (current-namespace))))]) (and (resolved-module-path? rmp) (resolved-module-path-name rmp)))) @@ -57,7 +61,7 @@ (or (get-path spec) (register-path spec (namespace->module-path-name - (module-spec->namespace spec) #f #f))))) + (module-spec->namespace spec #f #f)))))) (define (module-path-name->name path) (cond [(path? path) @@ -83,6 +87,17 @@ (define namespace->module-name (compose module-path-name->name namespace->module-path-name)) +(define (module-identifiers mod) + (define (extract-ids ls) + (append-map (lambda (idls) + (map car (cdr idls))) + ls)) + (let-values ([(reg syn) + (module-compiled-exports + (get-module-code (resolve-module-path + (ensure-module-spec mod) #f)))]) + (values (extract-ids reg) (extract-ids syn)))) + (define (skippable-dir? path) (call-with-values (lambda () (split-path path)) (lambda (_ basename __) |