From c00f24907cf87589f4b28885507443d419385502 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 15 Apr 2013 04:08:08 +0200 Subject: 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. --- elisp/geiser-racket.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'elisp') 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 -- cgit v1.2.3