emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/geiser-chez 1e91a62f72 1/2: fix: multiple arities in chez-


From: ELPA Syncer
Subject: [nongnu] elpa/geiser-chez 1e91a62f72 1/2: fix: multiple arities in chez-docs signatures
Date: Thu, 13 Oct 2022 23:58:31 -0400 (EDT)

branch: elpa/geiser-chez
commit 1e91a62f72d5403dc2651ab3f2156c446cbeed41
Author: jao <jao@gnu.org>
Commit: jao <jao@gnu.org>

    fix: multiple arities in chez-docs signatures
---
 src/geiser/geiser-data.ss | 13 ++++++++-----
 src/geiser/geiser.ss      | 10 +++-------
 2 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/src/geiser/geiser-data.ss b/src/geiser/geiser-data.ss
index f9fc81e342..0176e59cb3 100644
--- a/src/geiser/geiser-data.ss
+++ b/src/geiser/geiser-data.ss
@@ -17,20 +17,23 @@
 
 (library (geiser-data)
 
-  (export symbol-signature symbol-labels)
+  (export symbol-signatures symbol-labels)
   (import (chezscheme))
 
   (define (make-hash d)
     (let ((h (make-hashtable symbol-hash eq?)))
       (for-each (lambda (x)
                   (let ((id (car x))
-                        (sg (let ((a (with-input-from-string (cadr x) read)))
-                              (if (list? a) (cdr a) a))))
-                    (symbol-hashtable-set! h id (cons id (cons sg (cddr x))))))
+                        (sgs (let* ((s (format "(~a)" (cadr x)))
+                                    (as (with-input-from-string s read)))
+                               (and (list? as)
+                                    (list? (car as))
+                                    (map cdr (remove '~ as))))))
+                    (symbol-hashtable-set! h id (cons id (cons sgs (cddr 
x))))))
                 d)
       h))
 
-  (define (symbol-signature s)
+  (define (symbol-signatures s)
     (let ((x (or (symbol-hashtable-ref csug-data s #f)
                  (symbol-hashtable-ref tspl-data s #f))))
       (and x (list? (cadr x)) (cadr x))))
diff --git a/src/geiser/geiser.ss b/src/geiser/geiser.ss
index 806f5931d8..9ec73e81d1 100644
--- a/src/geiser/geiser.ss
+++ b/src/geiser/geiser.ss
@@ -187,15 +187,11 @@
            (l (string-length s)))
       (if (<= l max-len) s (string-append (substring s 0 sub-len) sub-str))))
 
-  (define (docs->parameter-list id)
-    (let ((s (symbol-signature id)))
-      (and s (list s))))
-
   (define (operator-arglist operator)
     (define (procedure-parameter-list id p)
       (and (procedure? p)
            (or (source->parameter-list p)
-               (docs->parameter-list id)
+               (symbol-signatures id)
                (arity->parameter-list p))))
     (define (autodoc-arglist* args req)
       (cond ((null? args) (list (list* "required" (reverse req))))
@@ -210,8 +206,8 @@
                   (arglists
                    `(,operator ("args" ,@(map autodoc-arglist arglists))))
                   (else `(,operator ("value" . ,(value->string binding))))))
-          (let ((s (symbol-signature operator)))
-            (if s `(,operator ("args" (("required" ,@s)))) '())))))
+          (let ((s (symbol-signatures operator)))
+            (if s `(,operator ("args" ,@(map autodoc-arglist s))) '())))))
 
   (define (geiser:autodoc ids)
     (cond ((null? ids) '())



reply via email to

[Prev in Thread] Current Thread [Next in Thread]