summaryrefslogtreecommitdiff
path: root/elisp/geiser-syntax.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
commitd70e9de59cfeae4fa8e76a48dbfe80e9d25e0d7c (patch)
tree32da929df5f7eda88da6e5ea926ca5d6a70710c9 /elisp/geiser-syntax.el
parente61a8e7c9068fab436b657ed42c1df2f73a8b6f3 (diff)
downloadgeiser-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-syntax.el')
-rw-r--r--elisp/geiser-syntax.el25
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: