summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-10-29 01:27:33 +0100
committerjao <jao@gnu.org>2022-10-29 01:27:33 +0100
commitd90a08de80ce9d2666fc1fd477a2743c64b45de0 (patch)
tree637017b0627dbfff424aed070fa00051751a5b2a /elisp
parent67fae675d40833fe10471a6b237a16efef03b845 (diff)
downloadgeiser-d90a08de80ce9d2666fc1fd477a2743c64b45de0.tar.gz
geiser-d90a08de80ce9d2666fc1fd477a2743c64b45de0.tar.bz2
geiser-doc: support for elisp-cooked docstrings
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-doc.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el
index 8c70d5f..123bc6c 100644
--- a/elisp/geiser-doc.el
+++ b/elisp/geiser-doc.el
@@ -50,6 +50,18 @@ 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.")
+(geiser-impl--define-caller geiser-doc--display-docstring
+ display-docstring (ret)
+ "This method receives the result of calling the geiser scheme
+procedure symbol-documentation and should display it in the
+current buffer. By default, geiser looks for the value of the
+key docstring in the result, assumed to be an alist, and inserts
+it verbatim at point if it's a string. Providing an
+implementation of this method may be useful if displaying the
+info returned by the scheme side (display-docstring) needs more
+elaboration on emacs' side. This method should return a truthy
+value if the default action should be skipped.")
+
;;; Documentation browser history:
@@ -360,7 +372,8 @@ help (e.g. browse an HTML page) implementing this method.")
(geiser-doc--insert-title
(geiser-autodoc--str* (cdr (assoc "signature" docstring))))
(newline)
- (insert (or (cdr (assoc "docstring" docstring)) ""))
+ (or (geiser-doc--display-docstring impl docstring)
+ (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