[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile 717f3d0 040/284: Fix for autodoc when point i
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile 717f3d0 040/284: Fix for autodoc when point in a rest formal arg in define. |
Date: |
Sun, 1 Aug 2021 18:29:12 -0400 (EDT) |
branch: elpa/geiser-guile
commit 717f3d004a19e9669d24519532133b14d971adf0
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
Fix for autodoc when point in a rest formal arg in define.
---
geiser/introspection.scm | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/geiser/introspection.scm b/geiser/introspection.scm
index 0a724f2..cab11fd 100644
--- a/geiser/introspection.scm
+++ b/geiser/introspection.scm
@@ -41,11 +41,12 @@
(define (autodoc form)
(cond ((null? form) #f)
((symbol? form) (describe-application (list form)))
+ ((and (pair? form) (not (list? form))) (autodoc (pair->list form)))
((list? form)
(let ((lst (last form)))
(cond ((symbol? lst) (or (describe-application (list lst))
(describe-application form)))
- ((list? lst)
+ ((pair? lst)
(or (autodoc lst)
(autodoc (map (lambda (s) (if (list? s) (gensym) s))
form))))
(else (describe-application form)))))
@@ -59,6 +60,12 @@
(cons 'position (find-position args form))
(cons 'module (symbol-module fun))))))
+(define (pair->list pair)
+ (let loop ((d pair) (s '()))
+ (cond ((null? d) (reverse! s))
+ ((symbol? d) (reverse! (cons d s)))
+ (else (loop (cdr d) (cons (car d) s))))))
+
(define (arglst args kind)
(let ((args (assq-ref args kind)))
(cond ((or (not args) (null? args)) '())
@@ -159,18 +166,13 @@
(define (local-bindings form)
(define (body f) (if (> (length f) 2) (cddr f) '()))
- (define (decl-list d)
- (let loop ((d d) (s '()))
- (cond ((null? d) s)
- ((symbol? d) (cons d s))
- (else (loop (cdr d) (cons (car d) s))))))
(let loop ((form form) (bindings '()))
(cond ((not (pair? form)) bindings)
((list? (car form))
(loop (cdr form) (append (local-bindings (car form)) bindings)))
((and (list? form) (< (length form) 2)) bindings)
((memq (car form) '(define define* lambda))
- (loop (body form) (append (decl-list (cadr form)) bindings)))
+ (loop (body form) (append (pair->list (cadr form)) bindings)))
((and (memq (car form) '(let let* letrec letrec*))
(list? (cadr form)))
(loop (body form) (append (map car (cadr form)) bindings)))
- [nongnu] elpa/geiser-guile 06fabb2 020/284: Compile command adapted to new compiled-file-name behaviour., (continued)
- [nongnu] elpa/geiser-guile 06fabb2 020/284: Compile command adapted to new compiled-file-name behaviour., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 3432ccf 021/284: New command: module documentation., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 08ba036 023/284: Separate commands for evaluation and compilation., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d18c35b 025/284: Fix in symbol help signature displaying., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 3655a74 026/284: (geiser eval) functionality moved to (geiser emacs)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 8377f5e 028/284: Refactoring of the eval/compile procedures., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 2ac3f91 027/284: Play nice with (ice-9 history) by using WRITE to return values to Emacs., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 49842df 031/284: Correct stack in load/compile file retorts., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 4608da2 032/284: Partial support for stack trace display., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 943e58b 039/284: Miscellaneous little fixes., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 717f3d0 040/284: Fix for autodoc when point in a rest formal arg in define.,
Philip Kaludercic <=
- [nongnu] elpa/geiser-guile ea9e341 041/284: Bug fix., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile acde425 043/284: Macro-expand commands., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 7fcb4ea 047/284: Autodoc enhancements:, Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile eeda11c 050/284: Leave quasiquote alone in autodoc., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile af8296f 051/284: generic-methods implemented in scheme (no emacs side yet)., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile ea52102 055/284: A bit more robust generic methods., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile c3d36f3 056/284: Don't display autodoc for function being defined., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile d5ff699 057/284: Refactoring., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile f36778f 059/284: Some tidy up., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile c52771f 062/284: Support for multiple Scheme implementations, Chapter 2., Philip Kaludercic, 2021/08/01