From 7cc98abc1d8ad68e350a176fb0d1ddbe7796fad1 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 28 Nov 2010 16:09:03 +0100 Subject: 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. --- elisp/geiser-autodoc.el | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'elisp/geiser-autodoc.el') 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 -- cgit v1.2.3