summaryrefslogtreecommitdiff
path: root/scheme/plt/geiser/completions.ss
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-09-07 00:23:17 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-09-07 00:23:17 +0200
commit8f5e58189692663901266dc83f2e2b4e47803b8d (patch)
treeaf04cbe37abec51cbf4106f06a497445904dc7a6 /scheme/plt/geiser/completions.ss
parent61edb258a45d5ad00ee907594c6dfbcd21d93485 (diff)
parent3a80af06f2b9272db379fed3b5b659ecfeeceb70 (diff)
downloadgeiser-guile-8f5e58189692663901266dc83f2e2b4e47803b8d.tar.gz
geiser-guile-8f5e58189692663901266dc83f2e2b4e47803b8d.tar.bz2
Merge branch 'devel'
Diffstat (limited to 'scheme/plt/geiser/completions.ss')
-rw-r--r--scheme/plt/geiser/completions.ss27
1 files changed, 4 insertions, 23 deletions
diff --git a/scheme/plt/geiser/completions.ss b/scheme/plt/geiser/completions.ss
index 4537feb..15bc081 100644
--- a/scheme/plt/geiser/completions.ss
+++ b/scheme/plt/geiser/completions.ss
@@ -35,29 +35,10 @@
(filter (lambda (s) (string-prefix? prefix s))
(if sort? (sort lst string<?) lst)))
-(define (symbol-completions prefix (context #f))
- (append (filter-prefix prefix
- (map symbol->string (local-bindings context))
- #f)
- (filter-prefix prefix
- (map symbol->string (namespace-mapped-symbols))
- #t)))
-
-(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 (symbol-completions prefix)
+ (filter-prefix prefix
+ (map symbol->string (namespace-mapped-symbols))
+ #t))
(define (module-completions prefix)
(filter-prefix prefix (module-list) #f))