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

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

[nongnu] elpa/geiser-guile 8cd5259 014/284: Small autodoc fixes.


From: Philip Kaludercic
Subject: [nongnu] elpa/geiser-guile 8cd5259 014/284: Small autodoc fixes.
Date: Sun, 1 Aug 2021 18:29:07 -0400 (EDT)

branch: elpa/geiser-guile
commit 8cd52599b79c2715f520f18a47b5198945e44187
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>

    Small autodoc fixes.
---
 geiser/introspection.scm | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/geiser/introspection.scm b/geiser/introspection.scm
index a158d66..cd48740 100644
--- a/geiser/introspection.scm
+++ b/geiser/introspection.scm
@@ -25,19 +25,19 @@
 ;;; Code:
 
 (define-module (geiser introspection)
-  #:export (arguments completions symbol-location)
+  #:export (arguments completions symbol-location docstring)
   #:use-module (system vm program)
   #:use-module (ice-9 session)
   #:use-module (srfi srfi-1))
 
 (define (arguments sym . syms)
   (let loop ((sym sym) (syms syms))
-    (cond ((obj-args (resolve-symbol sym)) => (lambda (args) (cons sym args)))
+    (cond ((obj-args (symbol->obj sym)) => (lambda (args) (cons sym args)))
           ((null? syms) #f)
           (else (loop (car syms) (cdr syms))))))
 
-(define (resolve-symbol sym)
-  (module-ref (current-module) sym))
+(define (symbol->obj sym)
+  (and (symbol? sym) (module-ref (current-module) sym)))
 
 (define (obj-args obj)
   (cond ((not obj) #f)
@@ -80,9 +80,11 @@
 (define (procedure-args-from-source name src)
   (let ((formals (cadr src)))
     (cond ((list? formals) (format-args formals #f (symbol-module name)))
-          ((pair? formals) (format-args (car formals)
-                                        (cdr formals)
-                                        (symbol-module name)))
+          ((pair? formals) (let ((req (car formals))
+                                 (opt (cdr formals)))
+                             (format-args (if (list? req) req (list req))
+                                          opt
+                                          (symbol-module name))))
           (else #f))))
 
 (define (macro-args macro)



reply via email to

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