summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-21 02:30:04 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-11-21 02:30:04 +0100
commitb437f54ca8154356f8f576f14f4c167f7f1fa8ff (patch)
treef57c422ac85663be5e9d36bfa2a5a538db2be7a8 /elisp
parent1710566476f5230d95e43cdceeab3487df76b69e (diff)
downloadgeiser-chez-b437f54ca8154356f8f576f14f4c167f7f1fa8ff.tar.gz
geiser-chez-b437f54ca8154356f8f576f14f4c167f7f1fa8ff.tar.bz2
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.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-autodoc.el17
-rw-r--r--elisp/geiser-doc.el4
2 files changed, 14 insertions, 7 deletions
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 " "))
diff --git a/elisp/geiser-doc.el b/elisp/geiser-doc.el
index b95242c..3778770 100644
--- a/elisp/geiser-doc.el
+++ b/elisp/geiser-doc.el
@@ -278,8 +278,8 @@ With prefix argument, ask for symbol (with completion)."
(geiser-doc--insert-title (format "%s" module) t)
(newline)
(dolist (g '(("Procedures:" . procs)
- ("Variables:" . vars)
- ("Syntax:" . syntax)))
+ ("Syntax:" . syntax)
+ ("Variables:" . vars)))
(geiser-doc--insert-list (car g)
(cdr (assoc (cdr g) exports))
module