summaryrefslogtreecommitdiff
path: root/elisp/geiser-autodoc.el
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-10-16 02:59:54 +0100
committerjao <jao@gnu.org>2022-10-16 02:59:54 +0100
commitc437b1eca906f9c06eb5acef49f84bc4a87d2b8b (patch)
tree76a8d0a65793cd5f2031e7d7dfc3d0fe99c66f4f /elisp/geiser-autodoc.el
parente320b982c43edffed2520ba5bfbbb5b4832aad52 (diff)
downloadgeiser-c437b1eca906f9c06eb5acef49f84bc4a87d2b8b.tar.gz
geiser-c437b1eca906f9c06eb5acef49f84bc4a87d2b8b.tar.bz2
fallback autodoc inferred via cheap regexps
same code that finds putative definitions, with all its caveats
Diffstat (limited to 'elisp/geiser-autodoc.el')
-rw-r--r--elisp/geiser-autodoc.el21
1 files changed, 11 insertions, 10 deletions
diff --git a/elisp/geiser-autodoc.el b/elisp/geiser-autodoc.el
index f9db008..51bad79 100644
--- a/elisp/geiser-autodoc.el
+++ b/elisp/geiser-autodoc.el
@@ -12,6 +12,7 @@
;;; Code:
+(require 'geiser-edit)
(require 'geiser-eval)
(require 'geiser-syntax)
(require 'geiser-custom)
@@ -178,16 +179,16 @@ you can set this variable to nil to avoid them."
(defun geiser-autodoc--autodoc (path callback &optional signs)
(let ((signs (or signs
- (geiser-autodoc--get-signatures (mapcar 'car path) callback)))
- (p (car path))
- (s))
- (if callback
- t
- (while (and p (not s))
- (unless (setq s (cdr (assoc (car p) signs)))
- (setq p (car path))
- (setq path (cdr path))))
- (when s (geiser-autodoc--str p s)))))
+ (geiser-autodoc--get-signatures (mapcar 'car path) callback))))
+ (or (and callback t)
+ (let ((p (car path))
+ (s))
+ (while (and p (not s))
+ (setq s (or (cdr (assoc (car p) signs))
+ (cdr (geiser-edit--find-def (car p)))))
+ (setq p (car path) path (cdr path)))
+ (cond ((stringp s) s)
+ (s (geiser-autodoc--str p s)))))))
;;; Autodoc functions: