[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/geiser-guile c34d042 091/284: Yet another deklugdification
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/geiser-guile c34d042 091/284: Yet another deklugdification: locals scanning moved to elisp. |
Date: |
Sun, 1 Aug 2021 18:29:22 -0400 (EDT) |
branch: elpa/geiser-guile
commit c34d04293ed5e2e67e4ed9422dbea54abd5d7f38
Author: Jose Antonio Ortega Ruiz <jao@gnu.org>
Commit: Jose Antonio Ortega Ruiz <jao@gnu.org>
Yet another deklugdification: locals scanning moved to elisp.
... and say goodbye to the ugly parse partial sexp, reducing not only
sloppy code, but also duplication and data transfers.
---
geiser/completion.scm | 25 +++----------------------
1 file changed, 3 insertions(+), 22 deletions(-)
diff --git a/geiser/completion.scm b/geiser/completion.scm
index f4342bb..564b8f5 100644
--- a/geiser/completion.scm
+++ b/geiser/completion.scm
@@ -31,28 +31,9 @@
#:use-module (ice-9 session)
#:use-module (ice-9 regex))
-(define (completions prefix . context)
- (let ((context (and (not (null? context)) (car context)))
- (prefix (string-append "^" (regexp-quote prefix))))
- (append (filter (lambda (s) (string-match prefix s))
- (map symbol->string (local-bindings context)))
- (sort! (map symbol->string (apropos-internal prefix)) string<?))))
-
-(define (local-bindings form)
- (define (body f) (if (> (length f) 2) (cddr f) '()))
- (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 (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)))
- ((and (eq? 'let (car form)) (symbol? (cadr form)))
- (loop (cons 'let (body form)) (cons (cadr form) bindings)))
- (else (loop (cdr form) bindings)))))
+(define (completions prefix)
+ (let ((prefix (string-append "^" (regexp-quote prefix))))
+ (sort! (map symbol->string (apropos-internal prefix)) string<?)))
(define (module-completions prefix)
(let* ((prefix (string-append "^" (regexp-quote prefix)))
- [nongnu] elpa/geiser-guile c52771f 062/284: Support for multiple Scheme implementations, Chapter 2., (continued)
- [nongnu] elpa/geiser-guile c52771f 062/284: Support for multiple Scheme implementations, Chapter 2., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile e912bbf 063/284: Multiple values as evaluation result supported., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 38da2b3 064/284: Misc nits and work in progress., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile ce78e11 069/284: Better xref display., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 4eeb068 071/284: Module completion generalized and implemented for PLT., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 63ebbc1 070/284: Using the new (system xref) interface., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 54484ab 075/284: Fixes for module names reading and evaluation result display., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile b14ac49 079/284: Guile: rewriting stack trace captures - not yet complete., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile b32aed7 077/284: module-children -> module-exports., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 19f55b0 097/284: New implementation registration mechanism, for the elisp side of things., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile c34d042 091/284: Yet another deklugdification: locals scanning moved to elisp.,
Philip Kaludercic <=
- [nongnu] elpa/geiser-guile a329773 094/284: BSD relicensing: Guile code., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 694539c 101/284: Guile: bug fix: a macro-transformer is not a good arity info source., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 8f57a6a 034/284: Autodoc system revamped., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile f48e83f 065/284: Accept a list as Guile binary., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 4e1d945 088/284: Simpler, more correct and efficient autodoc implementation., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 6d3f98b 085/284: Guile: unbreaking evaluation., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 0e5a52b 090/284: Leftover removed., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 58ae3a1 100/284: Cosmetics., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile 5807a76 105/284: Guile: adjustment to stack size display., Philip Kaludercic, 2021/08/01
- [nongnu] elpa/geiser-guile a405f22 104/284: Guile: fix for file loading (we always compile them now)., Philip Kaludercic, 2021/08/01