summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-02-03 01:03:20 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-02-03 01:03:20 +0100
commit5d713118a24a8766ea788288c1b47c96cf9bf5a6 (patch)
tree9c45559bc8c650eabfdfe9b248bef99b8c04ff54
parent0eaf8e78241b8bac9698ab3694d8060ac113fd56 (diff)
downloadgeiser-guile-5d713118a24a8766ea788288c1b47c96cf9bf5a6.tar.gz
geiser-guile-5d713118a24a8766ea788288c1b47c96cf9bf5a6.tar.bz2
PLT: Better help lookups.
-rw-r--r--elisp/geiser-plt.el13
-rw-r--r--scheme/plt/geiser/autodoc.ss6
-rw-r--r--scheme/plt/geiser/modules.ss1
3 files changed, 13 insertions, 7 deletions
diff --git a/elisp/geiser-plt.el b/elisp/geiser-plt.el
index 9fcd3f5..d9b3ca9 100644
--- a/elisp/geiser-plt.el
+++ b/elisp/geiser-plt.el
@@ -1,6 +1,6 @@
;; geiser-plt.el -- geiser support for PLT scheme
-;; Copyright (C) 2009 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010 Jose Antonio Ortega Ruiz
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the Modified BSD License. You should
@@ -112,10 +112,15 @@ This function uses `geiser-plt-init-file' if it exists."
;;; External help
-(defun geiser-plt--external-help (symbol module)
- (message "Requesting help for '%s'..." symbol)
+(defsubst geiser-plt--get-help (symbol module)
(geiser-eval--send/wait
- `(:eval (get-help ',symbol (:module ,module)) geiser/autodoc))
+ `(:eval (get-help ',symbol (:module ,module)) geiser/autodoc)))
+
+(defun geiser-plt--external-help (id module)
+ (message "Requesting help for '%s'..." id)
+ (let ((out (geiser-eval--retort-output (geiser-plt--get-help id module))))
+ (when (and out (string-match " but provided by:\n +\\(.+\\)\n" out))
+ (geiser-plt--get-help symbol (match-string 1 out))))
(minibuffer-message "%s done" (current-message))
t)
diff --git a/scheme/plt/geiser/autodoc.ss b/scheme/plt/geiser/autodoc.ss
index 6dd877c..65e095f 100644
--- a/scheme/plt/geiser/autodoc.ss
+++ b/scheme/plt/geiser/autodoc.ss
@@ -16,9 +16,9 @@
(require geiser/utils geiser/modules geiser/locations scheme/help)
(define (get-help symbol mod)
- (with-handlers ((exn? (lambda (e)
- (eval `(help ,symbol #:from ,mod)))))
- (eval `(help ,symbol))))
+ (with-handlers ((exn? (lambda (_)
+ (eval `(help ,symbol)))))
+ (eval `(help ,symbol #:from ,(ensure-module-spec mod)))))
(define (autodoc ids)
(if (not (list? ids))
diff --git a/scheme/plt/geiser/modules.ss b/scheme/plt/geiser/modules.ss
index eb5357f..1818ecd 100644
--- a/scheme/plt/geiser/modules.ss
+++ b/scheme/plt/geiser/modules.ss
@@ -12,6 +12,7 @@
#lang scheme
(provide load-module
+ ensure-module-spec
module-spec->namespace
namespace->module-path-name
module-path-name->name