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

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

[nongnu] elpa/geiser-guile 17ebbec 183/284: Autodoc: fix for improper ma


From: Philip Kaludercic
Subject: [nongnu] elpa/geiser-guile 17ebbec 183/284: Autodoc: fix for improper macro arglists scanning
Date: Sun, 1 Aug 2021 18:29:41 -0400 (EDT)

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

    Autodoc: fix for improper macro arglists scanning
---
 geiser/doc.scm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/geiser/doc.scm b/geiser/doc.scm
index 4722238..f5471b5 100644
--- a/geiser/doc.scm
+++ b/geiser/doc.scm
@@ -87,12 +87,14 @@
           (else #f))))
 
 (define (macro-args tf)
+  (define* (collect args #:optional (req '()))
+    (cond ((null? args) (arglist->args `(,(reverse req) #f #f r #f)))
+          ((symbol? args) (arglist->args `(,(reverse req) #f #f r ,args)))
+          ((and (pair? args) (symbol? (car args)))
+           (collect (cdr args) (cons (car args) req)))
+          (else #f)))
   (let* ((pats (procedure-property tf 'patterns))
-         (args (and pats (filter identity
-                                 (map (lambda (p)
-                                        (and (every symbol? p)
-                                             (list (cons 'required p))))
-                                      pats)))))
+         (args (and pats (filter-map collect pats))))
     (or (and args (not (null? args)) args) default-macro-args)))
 
 (define (arity->args art)



reply via email to

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