summaryrefslogtreecommitdiff
path: root/elisp/geiser-doc.el
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2014-09-15 16:49:47 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2014-09-23 03:22:51 +0200
commitec91996233fee632d068f2c6adb51fb64841fff3 (patch)
tree16bcfd954302bb42d3de0536eca56ad803c132a3 /elisp/geiser-doc.el
parentef96ae2fa94912f71069da84e691d337e03e2e28 (diff)
downloadgeiser-ec91996233fee632d068f2c6adb51fb64841fff3.tar.gz
geiser-ec91996233fee632d068f2c6adb51fb64841fff3.tar.bz2
company: implement --doc-buffer
Diffstat (limited to 'elisp/geiser-doc.el')
-rw-r--r--elisp/geiser-doc.el27
1 files changed, 15 insertions, 12 deletions
diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el
index 9c4eb4f..981a87c 100644
--- a/elisp/geiser-doc.el
+++ b/elisp/geiser-doc.el
@@ -287,6 +287,20 @@ help (e.g. browse an HTML page) implementing this method.")
impl)
impl))))
+(defun geiser-doc-symbol--fill-current-buffer (docstring symbol &optional module impl)
+ (erase-buffer)
+ (geiser-doc--insert-title
+ (geiser-autodoc--str* (cdr (assoc "signature" docstring))))
+ (newline)
+ (insert (or (cdr (assoc "docstring" docstring)) ""))
+ (geiser-doc--buttonize-modules impl)
+ (setq geiser-doc--buffer-link
+ (geiser-doc--history-push (geiser-doc--make-link symbol
+ module
+ impl)))
+ (geiser-doc--insert-footer impl)
+ (goto-char (point-min)))
+
(defun geiser-doc-symbol (symbol &optional module impl)
(let* ((impl (or impl geiser-impl--implementation))
(module (geiser-doc--module (or module (geiser-eval--get-module))
@@ -295,18 +309,7 @@ help (e.g. browse an HTML page) implementing this method.")
(if (or (not ds) (not (listp ds)))
(message "No documentation available for '%s'" symbol)
(geiser-doc--with-buffer
- (erase-buffer)
- (geiser-doc--insert-title
- (geiser-autodoc--str* (cdr (assoc "signature" ds))))
- (newline)
- (insert (or (cdr (assoc "docstring" ds)) ""))
- (geiser-doc--buttonize-modules impl)
- (setq geiser-doc--buffer-link
- (geiser-doc--history-push (geiser-doc--make-link symbol
- module
- impl)))
- (geiser-doc--insert-footer impl)
- (goto-char (point-min)))
+ (geiser-doc-symbol--fill-current-buffer ds symbol module impl))
(geiser-doc--pop-to-buffer)))))
(defun geiser-doc-symbol-at-point (&optional arg)