summaryrefslogtreecommitdiff
path: root/elisp/geiser-autodoc.el
diff options
context:
space:
mode:
Diffstat (limited to 'elisp/geiser-autodoc.el')
-rw-r--r--elisp/geiser-autodoc.el33
1 files changed, 18 insertions, 15 deletions
diff --git a/elisp/geiser-autodoc.el b/elisp/geiser-autodoc.el
index 6565d88..f6d36a8 100644
--- a/elisp/geiser-autodoc.el
+++ b/elisp/geiser-autodoc.el
@@ -122,21 +122,24 @@ when `geiser-autodoc-display-module-p' is on."
str))
(defun geiser-autodoc--str (signature pos module)
- (when signature
- (save-current-buffer
- (set-buffer (geiser-syntax--font-lock-buffer))
- (erase-buffer)
- (let* ((proc (car signature))
- (args (cdr signature))
- (current 1)
- (pos (if (> pos (length args)) (length args) pos)))
- (insert (format "(%s" (geiser-autodoc--proc-name proc module)))
- (dolist (a args)
- (insert " ")
- (geiser-autodoc--insert-arg a current pos)
- (setq current (1+ current)))
- (insert ")")
- (buffer-string)))))
+ (when (consp signature)
+ (let* ((proc (car signature))
+ (args (cdr signature))
+ (len (if (listp args) (length args) 0))
+ (current 1)
+ (pos (if (> pos len) len pos)))
+ (if (eq args 'variable)
+ (geiser-autodoc--proc-name proc module)
+ (save-current-buffer
+ (set-buffer (geiser-syntax--font-lock-buffer))
+ (erase-buffer)
+ (insert (format "(%s" (geiser-autodoc--proc-name proc module)))
+ (dolist (a args)
+ (insert " ")
+ (geiser-autodoc--insert-arg a current pos)
+ (setq current (1+ current)))
+ (insert ")")
+ (buffer-string))))))
;;; Autodoc function: