summaryrefslogtreecommitdiff
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
commit1c50bcb1e89ecad683148a4e67fecfc1d82a93ce (patch)
tree3c240e35c02f239825b83eb63824868b64bd05fb
parent63ebbc1c5343be09167f84090cf9cf69bb8e776a (diff)
downloadgeiser-guile-1c50bcb1e89ecad683148a4e67fecfc1d82a93ce.tar.gz
geiser-guile-1c50bcb1e89ecad683148a4e67fecfc1d82a93ce.tar.bz2
Improvements to module name support (using prefixes) and Guile support.
-rw-r--r--geiser/completion.scm9
-rw-r--r--geiser/emacs.scm2
-rw-r--r--geiser/modules.scm13
3 files changed, 15 insertions, 9 deletions
diff --git a/geiser/completion.scm b/geiser/completion.scm
index 4906368..f4342bb 100644
--- a/geiser/completion.scm
+++ b/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
diff --git a/geiser/emacs.scm b/geiser/emacs.scm
index 13bd8db..106b8b1 100644
--- a/geiser/emacs.scm
+++ b/geiser/emacs.scm
@@ -32,10 +32,10 @@
ge:load-file
ge:autodoc
ge:completions
+ ge:module-completions
ge:symbol-location
ge:generic-methods
ge:symbol-documentation
- ge:all-modules
ge:module-children
ge:module-location
ge:callers
diff --git a/geiser/modules.scm b/geiser/modules.scm
index fdc3f3f..834e51c 100644
--- a/geiser/modules.scm
+++ b/geiser/modules.scm
@@ -57,13 +57,12 @@
(define (all-modules)
(let ((roots ((@@ (ice-9 session) root-modules))))
- (sort! (map (lambda (m)
- (format "~A" (module-name m)))
- (fold (lambda (m all)
- (append (all-child-modules m) all))
- roots
- roots))
- string<?)))
+ (map (lambda (m)
+ (format "~A" (module-name m)))
+ (fold (lambda (m all)
+ (append (all-child-modules m) all))
+ roots
+ roots))))
(define (module-children mod-name)
(let* ((elts (hash-fold classify-module-object