summaryrefslogtreecommitdiff
path: root/scheme/guile/geiser/emacs.scm
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-10-30 22:46:12 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-10-30 22:46:12 +0200
commit7fe12503929dd8557a6daee1ad33d91ceef9293b (patch)
tree853fbf53c0abbb16238e9d7740f22b2e8ecc8821 /scheme/guile/geiser/emacs.scm
parent8e0535dff68717c4073d0933e304a7ad8c803870 (diff)
downloadgeiser-guile-7fe12503929dd8557a6daee1ad33d91ceef9293b.tar.gz
geiser-guile-7fe12503929dd8557a6daee1ad33d91ceef9293b.tar.bz2
Guile: using meta-commands to talk with Guile
Diffstat (limited to 'scheme/guile/geiser/emacs.scm')
-rw-r--r--scheme/guile/geiser/emacs.scm48
1 files changed, 21 insertions, 27 deletions
diff --git a/scheme/guile/geiser/emacs.scm b/scheme/guile/geiser/emacs.scm
index af1a052..c3696f8 100644
--- a/scheme/guile/geiser/emacs.scm
+++ b/scheme/guile/geiser/emacs.scm
@@ -10,37 +10,31 @@
;; Start date: Sun Feb 08, 2009 18:39
(define-module (geiser emacs)
- #:re-export (ge:macroexpand
- ge:compile-file
- ge:load-file
- ge:autodoc
- ge:completions
- ge:module-completions
- ge:symbol-location
- ge:generic-methods
- ge:symbol-documentation
- ge:module-exports
- ge:module-location
- ge:callers
- ge:callees
- ge:find-file)
- #:export (ge:compile
- ge:no-values
- ge:newline)
#:use-module (ice-9 match)
+ #:use-module (system repl command)
#:use-module (geiser evaluation)
#:use-module ((geiser modules) :renamer (symbol-prefix-proc 'ge:))
#:use-module ((geiser completion) :renamer (symbol-prefix-proc 'ge:))
#:use-module ((geiser xref) :renamer (symbol-prefix-proc 'ge:))
#:use-module ((geiser doc) :renamer (symbol-prefix-proc 'ge:)))
-(define (ge:no-values) (values))
-(define ge:newline newline)
-
-(define (ge:compile form mod)
- (match form
- (`((@ (geiser emacs) . ,_) . ,_) (compile/no-warns form mod))
- (_ (compile/warns form mod))))
-
-
-;;; emacs.scm ends here
+(define this-module (resolve-module '(geiser emacs)))
+
+(define-meta-command ((geiser-no-values geiser) repl)
+ "geiser-no-values
+No-op command used internally by Geiser."
+ (values))
+
+(define-meta-command ((geiser-eval geiser) repl mod form . args)
+ "geiser-eval
+Meta-command used by Geiser to evaluate and compile code."
+ (display form) (newline)
+ (if (null? args)
+ (ge:compile form mod)
+ (let ((proc (eval form this-module)))
+ (ge:eval `(,proc ,@args) mod))))
+
+(define-meta-command ((geiser-load-file geiser) repl file)
+ "geiser-load-file
+Meta-command used by Geiser to load and compile files."
+ (ge:compile-file file))