diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-09-07 00:23:17 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-09-07 00:23:17 +0200 |
commit | e34f3ab3867e826ffd75fb048611f5f8ad9993e0 (patch) | |
tree | 659e9cbb5a059b2f2bbfcb05dd08422990c93bb8 /elisp/geiser-doc.el | |
parent | f9d746bd4600d34d3b3fe72d5159b58d6160bfb9 (diff) | |
parent | fff6b102f88479f470d3d02a905674c594edb154 (diff) | |
download | geiser-e34f3ab3867e826ffd75fb048611f5f8ad9993e0.tar.gz geiser-e34f3ab3867e826ffd75fb048611f5f8ad9993e0.tar.bz2 |
Merge branch 'devel'
Diffstat (limited to 'elisp/geiser-doc.el')
-rw-r--r-- | elisp/geiser-doc.el | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el index 8024239..29f0de2 100644 --- a/elisp/geiser-doc.el +++ b/elisp/geiser-doc.el @@ -24,7 +24,9 @@ ;;; Code: +(require 'geiser-impl) (require 'geiser-completion) +(require 'geiser-autodoc) (require 'geiser-eval) (require 'geiser-syntax) (require 'geiser-popup) @@ -157,32 +159,27 @@ ;;; 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))) + (geiser-eval--send/result + `(:eval ((:ge symbol-documentation) ',symbol) ,module))) (defun geiser-doc--get-module-exports (module) (geiser-eval--send/result `(:eval ((:ge module-exports) (:module ,module))))) (defun geiser-doc-symbol (symbol &optional module impl) - (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))) + (let ((module (or module (geiser-eval--get-module))) + (impl (or impl geiser-impl--implementation))) + (unless (geiser-impl--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) (geiser-doc--with-buffer (erase-buffer) - (geiser-doc--insert-title (cdr (assoc 'signature ds))) + (geiser-doc--insert-title (geiser-autodoc--str (list (format "%s" symbol) 0) + (cdr (assoc 'signature ds)))) (newline) (insert (or (cdr (assoc 'docstring ds)) "")) - (goto-line (point-min)) + (goto-char (point-min)) (setq geiser-doc--buffer-link (geiser-doc--history-push (geiser-doc--make-link symbol module impl)))) @@ -193,7 +190,8 @@ With prefix argument, ask for symbol (with completion)." (interactive "P") (let ((symbol (or (and (not arg) (symbol-at-point)) - (geiser-completion--read-symbol "Symbol: " (symbol-at-point))))) + (geiser-completion--read-symbol "Symbol: " + (symbol-at-point))))) (when symbol (geiser-doc-symbol symbol)))) @@ -219,7 +217,8 @@ With prefix argument, ask for symbol (with completion)." impl)) (goto-char (point-min)) (setq geiser-doc--buffer-link - (geiser-doc--history-push (geiser-doc--make-link nil module impl)))) + (geiser-doc--history-push + (geiser-doc--make-link nil module impl)))) (geiser-doc--pop-to-buffer)))) (defun geiser-doc-next (&optional forget-current) |