emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/geiser-racket efb71a2 127/191: Racket: ensuring the first


From: Philip Kaludercic
Subject: [nongnu] elpa/geiser-racket efb71a2 127/191: Racket: ensuring the first C-c C-d C-i works
Date: Sun, 1 Aug 2021 18:32:14 -0400 (EDT)

branch: elpa/geiser-racket
commit efb71a2dee0f1609ad3a5576ae23c08c64839571
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>

    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.
---
 geiser/autodoc.rkt | 12 ++++++++++++
 geiser/user.rkt    |  4 ----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/geiser/autodoc.rkt b/geiser/autodoc.rkt
index 08455e5..04a0c09 100644
--- a/geiser/autodoc.rkt
+++ b/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/geiser/user.rkt b/geiser/user.rkt
index 9b07b95..b3112f2 100644
--- a/geiser/user.rkt
+++ b/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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]