diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-17 00:44:11 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-02-17 00:44:11 +0100 |
commit | 4814d02ad67edb086b8ccd8ad6a6798fe780b968 (patch) | |
tree | f0d2e45fe5cc4020f0b5d3ea8c9dd063f9bfa243 /elisp/geiser-eval.el | |
parent | f574939e5db2f64eab21493bb70ac6605f76646f (diff) | |
download | geiser-4814d02ad67edb086b8ccd8ad6a6798fe780b968.tar.gz geiser-4814d02ad67edb086b8ccd8ad6a6798fe780b968.tar.bz2 |
Separate commands for evaluation and compilation.
Diffstat (limited to 'elisp/geiser-eval.el')
-rw-r--r-- | elisp/geiser-eval.el | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/elisp/geiser-eval.el b/elisp/geiser-eval.el index b1bd83b..4566d0b 100644 --- a/elisp/geiser-eval.el +++ b/elisp/geiser-eval.el @@ -38,22 +38,30 @@ ((eq code :f) "#f") ((eq code :t) "#t") ((listp code) - (cond ((eq (car code) :gs) (geiser-eval--gs (cdr code))) + (cond ((eq (car code) :eval) (geiser-eval--eval (cdr code))) + ((eq (car code) :comp) (geiser-eval--comp (cdr code))) + ((eq (car code) :module) (geiser-eval--module (cadr code))) ((eq (car code) :ge) (geiser-eval--ge (cadr code))) ((eq (car code) :scm) (cadr code)) (t (concat "(" (mapconcat 'geiser-eval--scheme-str code " ") ")")))) ((symbolp code) (format "%s" code)) (t (format "%S" code)))) -(defsubst geiser-eval--gs (code) - (concat "((@ (geiser eval) eval-in) (quote " - (geiser-eval--scheme-str (nth 0 code)) - ") (quote " - (or (and (nth 1 code) - (geiser-eval--scheme-str (nth 1 code))) - (geiser-syntax--buffer-module) - "#f") - "))")) +(defsubst geiser-eval--eval (code) + (geiser-eval--scheme-str + `((@ (geiser eval) eval-in) (quote ,(nth 0 code)) (:module ,(nth 1 code))))) + +(defsubst geiser-eval--comp (code) + (geiser-eval--scheme-str + `((@ (geiser eval) compile-in) (quote ,(nth 0 code)) (:module ,(nth 1 code))))) + +(defsubst geiser-eval--module (code) + (geiser-eval--scheme-str + (cond ((or (eq code '(())) (null code)) + `(quote ,(or (geiser-syntax--buffer-module) :f))) + ((listp code) `(quote ,code)) + ((stringp code) (:scm code)) + (t (error "Invalid module spec: %S" code))))) (defsubst geiser-eval--ge (proc) (format "(@ (geiser emacs) ge:%s)" proc)) |