summaryrefslogtreecommitdiff
path: root/scheme/guile/geiser/completion.scm
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-05-11 01:22:49 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-05-11 01:22:49 +0200
commitd7657c533921de69d1805f7bf3b40d9426d7800b (patch)
tree89db151833ddf64347f2de819ae04f74a19c4947 /scheme/guile/geiser/completion.scm
parentc09f5bbaa836d04a9babdff0943dc596dbc68e38 (diff)
downloadgeiser-guile-d7657c533921de69d1805f7bf3b40d9426d7800b.tar.gz
geiser-guile-d7657c533921de69d1805f7bf3b40d9426d7800b.tar.bz2
Improvements to module name support (using prefixes) and Guile support.
Diffstat (limited to 'scheme/guile/geiser/completion.scm')
-rw-r--r--scheme/guile/geiser/completion.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/scheme/guile/geiser/completion.scm b/scheme/guile/geiser/completion.scm
index 4906368..f4342bb 100644
--- a/scheme/guile/geiser/completion.scm
+++ b/scheme/guile/geiser/completion.scm
@@ -25,8 +25,9 @@
;;; Code:
(define-module (geiser completion)
- #:export (completions)
+ #:export (completions module-completions)
#:use-module (geiser utils)
+ #:use-module (geiser modules)
#:use-module (ice-9 session)
#:use-module (ice-9 regex))
@@ -53,4 +54,10 @@
(loop (cons 'let (body form)) (cons (cadr form) bindings)))
(else (loop (cdr form) bindings)))))
+(define (module-completions prefix)
+ (let* ((prefix (string-append "^" (regexp-quote prefix)))
+ (matcher (lambda (s) (string-match prefix s)))
+ (names (filter matcher (all-modules))))
+ (sort! names string<?)))
+
;;; completions.scm ends here