summaryrefslogtreecommitdiff
path: root/elisp/geiser-autodoc.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-28 16:09:03 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-28 16:09:03 +0100
commit7cc98abc1d8ad68e350a176fb0d1ddbe7796fad1 (patch)
tree3cb6f17dcb40345a4f077f42001446be3197175a /elisp/geiser-autodoc.el
parent707d0afb8c443f1c6e624d6d432b21ca44636937 (diff)
downloadgeiser-7cc98abc1d8ad68e350a176fb0d1ddbe7796fad1.tar.gz
geiser-7cc98abc1d8ad68e350a176fb0d1ddbe7796fad1.tar.bz2
Autodoc's argument display fixed
It was relying on symbol equality, and not dealing correctly with keyword arguments in this new external world. In the process, some cleanups to the scheme data display code.
Diffstat (limited to 'elisp/geiser-autodoc.el')
-rw-r--r--elisp/geiser-autodoc.el25
1 files changed, 9 insertions, 16 deletions
diff --git a/elisp/geiser-autodoc.el b/elisp/geiser-autodoc.el
index 8222e0b..a338bb9 100644
--- a/elisp/geiser-autodoc.el
+++ b/elisp/geiser-autodoc.el
@@ -90,21 +90,11 @@ when `geiser-autodoc-display-module-p' is on."
(t '("..."))))
(defun geiser-autodoc--format-arg (a)
- (cond ((null a) "()")
- ((symbolp a) (format "%s" a))
- ((equal a "...") "...")
- ((stringp a) (format "%S" a))
- ((and (listp a) (keywordp (car a)))
+ (cond ((and (listp a) (geiser-syntax--keywordp (car a)))
(if (and (cdr a) (listp (cdr a)))
- (format "(#%s %s)" (car a) (geiser-autodoc--format-arg (cadr a)))
+ (format "(#%s %s)" (car a) (geiser-syntax--display (cadr a)))
(format "(#%s)" (car a))))
- ((and (listp a) (eq (car a) 'quote))
- (format "'%s" (geiser-autodoc--format-arg (cadr a))))
- ((listp a) (format "(%s)"
- (mapconcat 'geiser-autodoc--format-arg
- (geiser-autodoc--sanitize-args a)
- " ")))
- (t (format "%s" a))))
+ (t (geiser-syntax--display a))))
(defun geiser-autodoc--insert-arg-group (args current &optional pos)
(when args (insert " "))
@@ -115,9 +105,9 @@ when `geiser-autodoc-display-module-p' is on."
(numberp current)
(setq current (1+ current))
(= (1+ pos) current))
- (and (keywordp current)
+ (and (geiser-syntax--keywordp current)
(listp a)
- (eq current (car a))))
+ (geiser-syntax--symbol-eq current (car a))))
(put-text-property p (point)
'face 'geiser-font-lock-autodoc-current-arg)
(setq pos nil current nil)))
@@ -129,7 +119,10 @@ when `geiser-autodoc-display-module-p' is on."
(let ((cpos 1)
(reqs (cdr (assoc "required" args)))
(opts (mapcar (lambda (a)
- (if (and (symbolp a) (not (eq a '...))) (list a) a))
+ (if (and (symbolp a)
+ (not (equal (symbol-name a) "...")))
+ (list a)
+ a))
(cdr (assoc "optional" args))))
(keys (cdr (assoc "key" args))))
(setq cpos