From b32cc5ea37430c5d06ba2964ccdc430ce0faad80 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 15 Apr 2013 11:13:02 +0200 Subject: 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. --- scheme/racket/geiser/autodoc.rkt | 12 ++++++++++++ scheme/racket/geiser/user.rkt | 4 ---- 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) -- cgit v1.2.3