diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-04-27 21:28:51 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-04-27 21:28:51 +0200 |
commit | 31a4bd02c78be39cdd4a58bbc286a57906a525ce (patch) | |
tree | 6f1cc852425f3dcf10bac4aae17db9baa5e5e24f /elisp/geiser-doc.el | |
parent | 71cb453f51d7cd04834916a5df0b477f9175853c (diff) | |
download | geiser-guile-31a4bd02c78be39cdd4a58bbc286a57906a525ce.tar.gz geiser-guile-31a4bd02c78be39cdd4a58bbc286a57906a525ce.tar.bz2 |
Support for external help functions (and application to PLT).
Diffstat (limited to 'elisp/geiser-doc.el')
-rw-r--r-- | elisp/geiser-doc.el | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el index 60800f4..2fc9f69 100644 --- a/elisp/geiser-doc.el +++ b/elisp/geiser-doc.el @@ -157,6 +157,13 @@ ;;; Commands: +(make-variable-buffer-local + (defvar geiser-doc--external-help-function nil)) + +(defun geiser-doc--external-help (symbol module) + (and geiser-doc--external-help-function + (funcall geiser-doc--external-help-function symbol module))) + (defun geiser-doc--get-docstring (symbol module) (geiser-eval--send/result `(:eval ((:ge symbol-documentation) ',symbol) ,module))) @@ -164,21 +171,22 @@ (geiser-eval--send/result `(:eval ((:ge module-children) (:module ,module))))) (defun geiser-doc-symbol (symbol &optional module impl) - (let* ((module (or module (geiser-eval--get-module))) - (impl (or impl geiser-impl--implementation)) - (ds (geiser-doc--get-docstring symbol module))) - (if (or (not ds) (not (listp ds))) - (message "No documentation available for '%s'" symbol) - (geiser-doc--with-buffer - (erase-buffer) - (geiser-doc--insert-title (cdr (assoc 'signature ds))) - (newline) - (insert (or (cdr (assoc 'docstring ds)) "")) - (goto-line (point-min)) - (setq geiser-doc--buffer-link - (geiser-doc--history-push - (geiser-doc--make-link symbol module impl)))) - (geiser-doc--pop-to-buffer)))) + (let ((module (or module (geiser-eval--get-module)))) + (unless (geiser-doc--external-help symbol module) + (let ((impl (or impl geiser-impl--implementation)) + (ds (geiser-doc--get-docstring symbol module))) + (if (or (not ds) (not (listp ds))) + (message "No documentation available for '%s'" symbol) + (geiser-doc--with-buffer + (erase-buffer) + (geiser-doc--insert-title (cdr (assoc 'signature ds))) + (newline) + (insert (or (cdr (assoc 'docstring ds)) "")) + (goto-line (point-min)) + (setq geiser-doc--buffer-link + (geiser-doc--history-push + (geiser-doc--make-link symbol module impl)))) + (geiser-doc--pop-to-buffer)))))) (defun geiser-doc-symbol-at-point (&optional arg) "Get docstring for symbol at point. |