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 | 7cc98abc1d8ad68e350a176fb0d1ddbe7796fad1 (patch) | |
tree | 3cb6f17dcb40345a4f077f42001446be3197175a /elisp/geiser-syntax.el | |
parent | 707d0afb8c443f1c6e624d6d432b21ca44636937 (diff) | |
download | geiser-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-syntax.el')
-rw-r--r-- | elisp/geiser-syntax.el | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/elisp/geiser-syntax.el b/elisp/geiser-syntax.el index ce5a7af..d6c6f91 100644 --- a/elisp/geiser-syntax.el +++ b/elisp/geiser-syntax.el @@ -235,6 +235,31 @@ implementation-specific entries for font-lock-keywords.") (let ((geiser-syntax--read/buffer-limit (and (numberp boundary) boundary))) (save-excursion (values (geiser-syntax--read) (point))))) +(defun geiser-syntax--mapconcat (fun lst sep) + (cond ((null lst) "") + ((not (listp lst)) (format ".%s%s" sep (funcall fun lst))) + ((null (cdr lst)) (format "%s" (funcall fun (car lst)))) + (t (format "%s%s%s" + (funcall fun (car lst)) + sep + (geiser-syntax--mapconcat fun (cdr lst) sep))))) + +(defun geiser-syntax--display (a) + (cond ((null a) "()") + ((eq a :t) "#t") + ((eq a :f) "#f") + ((geiser-syntax--keywordp a) (format "#%s" a)) + ((symbolp a) (format "%s" a)) + ((equal a "...") "...") + ((stringp a) (format "%S" a)) + ((and (listp a) (symbolp (car a)) + (equal (symbol-name (car a)) "quote")) + (format "'%s" (geiser-syntax--display (cadr a)))) + ((listp a) + (format "(%s)" + (geiser-syntax--mapconcat 'geiser-syntax--display a " "))) + (t (format "%s" a)))) + ;;; Code parsing: |