summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2013-04-15 04:08:08 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-04-15 04:08:08 +0200
commitc00f24907cf87589f4b28885507443d419385502 (patch)
treead53486c2f6654ec8263cf367138baba2be7261a /elisp
parent82165389e02b4ff29bade2a2b34903142e3bc73a (diff)
downloadgeiser-chez-c00f24907cf87589f4b28885507443d419385502.tar.gz
geiser-chez-c00f24907cf87589f4b28885507443d419385502.tar.bz2
Racket: better help commands
For some reason that i don't fully understand, evaluating a function in the racket/base namespace first thing after loading errortrace breaks the help macro (!). This patches provides a workaround by actually invoking help first thing when Geiser starts, with alibi that it serves to preload the help index (in a separate thread). While i was at it, i improved the message printed in the minibuffer when no help is found.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-racket.el20
1 files changed, 10 insertions, 10 deletions
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el
index 24712bd..42bb219 100644
--- a/elisp/geiser-racket.el
+++ b/elisp/geiser-racket.el
@@ -89,8 +89,7 @@ This function uses `geiser-racket-init-file' if it exists."
(expand-file-name geiser-racket-init-file)))
(binary (geiser-racket--real-binary))
(rackdir (expand-file-name "racket/" geiser-scheme-dir)))
- `("-i" "-q"
- "-S" ,rackdir
+ `("-i" "-q" "-S" ,rackdir
,@(apply 'append (mapcar (lambda (p) (list "-S" p))
geiser-racket-collects))
,@(and (listp binary) (cdr binary))
@@ -203,17 +202,18 @@ using start-geiser, a procedure in the geiser/server module."
;;; External help
(defsubst geiser-racket--get-help (symbol module)
- (geiser-eval--send/wait
- `(:eval (get-help ',symbol '(:module ,module)) geiser/autodoc)))
+ (geiser-eval--send/wait `(:scm ,(format ",help %s %s" symbol module))))
(defun geiser-racket--external-help (id module)
(message "Looking up manual for '%s'..." id)
- (let ((out (geiser-eval--retort-output
- (geiser-racket--get-help id module))))
- (when (and out (string-match " but provided by:\n +\\(.+\\)\n" out))
- (geiser-racket--get-help id (match-string 1 out))))
- (minibuffer-message "%s done" (current-message))
- t)
+ (let* ((ret (geiser-racket--get-help id module))
+ (out (geiser-eval--retort-output ret))
+ (ret (if (and out (string-match " but provided by:\n +\\(.+\\)\n" out))
+ (geiser-racket--get-help id (match-string 1 out))
+ ret))
+ (msg (if (geiser-eval--retort-error ret) "not found" "done")))
+ (minibuffer-message "%s %s" (current-message) msg)
+ t))
;;; Error display