From 5c9a941ddc6cbbb3b62f04b55b04e29e493c01fa Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 21 Nov 2010 02:30:04 +0100 Subject: Even better, as in 'correct', display of autodoc args We're being a bit silly here, first converting the autodoc retort string to an elisp value and then reconverting the arguments again to a string with scheme syntax. We should probably do this at geiser-syntax's parser level, with a special mode producing stringy representations of tokens. Don't tell anyone. --- elisp/geiser-autodoc.el | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'elisp/geiser-autodoc.el') diff --git a/elisp/geiser-autodoc.el b/elisp/geiser-autodoc.el index 5bdfb1a..2873bb0 100644 --- a/elisp/geiser-autodoc.el +++ b/elisp/geiser-autodoc.el @@ -87,11 +87,18 @@ when `geiser-autodoc-display-module-p' is on." (t '...))) (defun geiser-autodoc--format-arg (a) - (if (and (listp a) (keywordp (car a))) - (if (and (cdr a) (listp (cdr a))) - (format "(#%s %s)" (car a) (cadr a)) - (format "(#%s)" (car a))) - (format "%s" a))) + (cond ((null a) "()") + ((symbolp a) (format "%s" a)) + ((stringp a) (format "%S" a)) + ((and (listp a) (keywordp (car a))) + (if (and (cdr a) (listp (cdr a))) + (format "(#%s %s)" (car a) (geiser-autodoc--format-arg (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 a " "))) + (t (format "%S" a)))) (defun geiser-autodoc--insert-arg-group (args current &optional pos) (when args (insert " ")) -- cgit v1.2.3