summaryrefslogtreecommitdiff
path: root/scheme/racket
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2013-04-15 11:13:02 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-04-15 11:13:02 +0200
commitb32cc5ea37430c5d06ba2964ccdc430ce0faad80 (patch)
treea1c3183be4d9063bd5211e4c93bd01040f36081a /scheme/racket
parent82f909d80a55f0dcf8639b094351f5e61f3449e6 (diff)
downloadgeiser-guile-b32cc5ea37430c5d06ba2964ccdc430ce0faad80.tar.gz
geiser-guile-b32cc5ea37430c5d06ba2964ccdc430ce0faad80.tar.bz2
Racket: ensuring the first C-c C-d C-i works
... by the obvious device of waiting for the thread building the index to finish.
Diffstat (limited to 'scheme/racket')
-rw-r--r--scheme/racket/geiser/autodoc.rkt12
-rw-r--r--scheme/racket/geiser/user.rkt4
2 files changed, 12 insertions, 4 deletions
diff --git a/scheme/racket/geiser/autodoc.rkt b/scheme/racket/geiser/autodoc.rkt
index 08455e5..04a0c09 100644
--- a/scheme/racket/geiser/autodoc.rkt
+++ b/scheme/racket/geiser/autodoc.rkt
@@ -15,6 +15,7 @@
symbol-documentation
module-exports
update-signature-cache
+ preload-help
get-help)
(require racket/help
@@ -22,9 +23,20 @@
geiser/modules
geiser/locations)
+(define loader-thread #f)
+
+(define (preload-help)
+ (set! loader-thread
+ (thread (lambda ()
+ (with-output-to-string (lambda ()
+ (help meh-i-dont-exist)))))))
+
(define here (current-namespace))
(define (get-help symbol mod)
+ (when loader-thread
+ (thread-wait loader-thread)
+ (set! loader-thread #f))
(if (eq? symbol mod)
(get-mod-help mod)
(with-handlers ([exn? (lambda (_) (eval `(help ,symbol) here))])
diff --git a/scheme/racket/geiser/user.rkt b/scheme/racket/geiser/user.rkt
index 9b07b95..b3112f2 100644
--- a/scheme/racket/geiser/user.rkt
+++ b/scheme/racket/geiser/user.rkt
@@ -96,10 +96,6 @@
(define (geiser-prompt-read prompt)
(make-repl-reader (geiser-read prompt)))
-(define (preload-help)
- (thread (lambda ()
- (with-output-to-string (lambda () (help meh-i-dont-exist))))))
-
(define (init-geiser-repl)
(compile-enforce-module-constants #f)
(current-load/use-compiled geiser-loader)