summaryrefslogtreecommitdiff
path: root/elisp/geiser-doc.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-09-22 22:43:28 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-09-22 22:43:28 +0200
commit5f64d69c0e8c100c5a9954a0b1317d9d345a78e2 (patch)
tree46fdfde9f3ea107b49c7555886eca68301f13553 /elisp/geiser-doc.el
parentaecb2b8a0debdfd29e6865c2f4854b37210d9160 (diff)
downloadgeiser-5f64d69c0e8c100c5a9954a0b1317d9d345a78e2.tar.gz
geiser-5f64d69c0e8c100c5a9954a0b1317d9d345a78e2.tar.bz2
New implementation registration mechanism, for the elisp side of things.
Implementations must invoke define-geiser-implementation with an appropriate set of methods. Simple inheritance is supported. Each geiser module defines and registers the method names it uses.
Diffstat (limited to 'elisp/geiser-doc.el')
-rw-r--r--elisp/geiser-doc.el17
1 files changed, 11 insertions, 6 deletions
diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el
index 977b074..94f0505 100644
--- a/elisp/geiser-doc.el
+++ b/elisp/geiser-doc.el
@@ -90,13 +90,12 @@
(defun geiser-doc--follow-link (link)
(let ((target (geiser-doc--link-target link))
(module (geiser-doc--link-module link))
- (impl (or (geiser-doc--link-impl link)
- (geiser-impl--default-implementation))))
+ (impl (geiser-doc--link-impl link)))
(when (and (or target module) impl)
(with--geiser-implementation impl
- `(lambda () (if (null ',target)
- (geiser-doc-module ',module ',impl)
- (geiser-doc-symbol ',target ',module ',impl)))))))
+ (if (null target)
+ (geiser-doc-module module impl)
+ (geiser-doc-symbol target module impl))))))
(defun geiser-doc--button-action (button)
(let ((link (button-get button 'geiser-link)))
@@ -146,6 +145,12 @@
;;; Commands:
+(geiser-impl--define-caller geiser-doc--external-help external-help (symbol module)
+ "By default, Geiser will display help about an identifier in a
+help buffer, after collecting the associated signature and
+docstring. You can provide an alternative function for displaying
+help (e.g. browse an HTML page) implementing this method.")
+
(defun geiser-doc--get-docstring (symbol module)
(geiser-eval--send/result
`(:eval ((:ge symbol-documentation) ',symbol) ,module)))
@@ -156,7 +161,7 @@
(defun geiser-doc-symbol (symbol &optional module impl)
(let ((module (or module (geiser-eval--get-module)))
(impl (or impl geiser-impl--implementation)))
- (unless (geiser-impl--external-help impl symbol module)
+ (unless (geiser-doc--external-help impl symbol module)
(let ((ds (geiser-doc--get-docstring symbol module)))
(if (or (not ds) (not (listp ds)))
(message "No documentation available for '%s'" symbol)