diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-28 16:09:03 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-11-28 16:09:03 +0100 |
commit | d70e9de59cfeae4fa8e76a48dbfe80e9d25e0d7c (patch) | |
tree | 32da929df5f7eda88da6e5ea926ca5d6a70710c9 /elisp/geiser-autodoc.el | |
parent | e61a8e7c9068fab436b657ed42c1df2f73a8b6f3 (diff) | |
download | geiser-chez-d70e9de59cfeae4fa8e76a48dbfe80e9d25e0d7c.tar.gz geiser-chez-d70e9de59cfeae4fa8e76a48dbfe80e9d25e0d7c.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.el | 25 |
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 |