summaryrefslogtreecommitdiff
path: root/elisp/geiser-company.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-company.el
parentef96ae2fa94912f71069da84e691d337e03e2e28 (diff)
downloadgeiser-ec91996233fee632d068f2c6adb51fb64841fff3.tar.gz
geiser-ec91996233fee632d068f2c6adb51fb64841fff3.tar.bz2
company: implement --doc-buffer
Diffstat (limited to 'elisp/geiser-company.el')
-rw-r--r--elisp/geiser-company.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/elisp/geiser-company.el b/elisp/geiser-company.el
index 101cbbd..1c4b5f0 100644
--- a/elisp/geiser-company.el
+++ b/elisp/geiser-company.el
@@ -15,6 +15,7 @@
(require 'geiser-completion)
(require 'geiser-edit)
(require 'geiser-base)
+(require 'geiser-doc)
(eval-when-compile (require 'cl))
@@ -40,7 +41,16 @@
(let ((help (geiser-autodoc--autodoc `((,id 0)))))
(and help (substring-no-properties help))))))
-(defsubst geiser-company--doc-buffer (id) nil)
+(defun geiser-company--doc-buffer (id)
+ (let* ((impl geiser-impl--implementation)
+ (module (geiser-doc-module (geiser-eval--get-module) impl))
+ (symbol (make-symbol id))
+ (ds (geiser-doc--get-docstring symbol module)))
+ (if (or (not ds) (not (listp ds)))
+ (message "No documentation available for '%s'" symbol)
+ (with-current-buffer (get-buffer-create "*company-documentation*")
+ (geiser-doc-symbol--fill-current-buffer ds symbol module impl)
+ (current-buffer)))))
(defun geiser-company--location (id)
(ignore-errors