summaryrefslogtreecommitdiff
path: root/elisp/geiser-racket.el
diff options
context:
space:
mode:
Diffstat (limited to 'elisp/geiser-racket.el')
-rw-r--r--elisp/geiser-racket.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el
index f38a4e9..0150772 100644
--- a/elisp/geiser-racket.el
+++ b/elisp/geiser-racket.el
@@ -93,12 +93,19 @@ This function uses `geiser-racket-init-file' if it exists."
(if (re-search-forward
"^\\(?:#lang\\|(module +[^ ]+?\\) +\\([^ ]+?\\|([^)]+)\\) *$" nil t)
(car (geiser-syntax--read-from-string (match-string-no-properties 1)))
- :f)))
-
-(defun geiser-racket--geiser-procedure (proc)
- (if (memq proc '(eval compile))
- `((dynamic-require 'geiser 'geiser:eval) ',(geiser-racket--language))
- `(dynamic-require 'geiser ',(intern (format "geiser:%s" proc)))))
+ "#f")))
+
+(defun geiser-racket--geiser-procedure (proc &rest args)
+ (case proc
+ ((eval compile)
+ (format ",eval %s %s %s"
+ (or (car args) "#f")
+ (geiser-racket--language)
+ (mapconcat 'identity (cdr args) " ")))
+ ((load-file compile-file)
+ (format ",eval geiser/main racket (geiser:%s %s)" proc (car args)))
+ ((no-values) ",no-values")
+ (t (format ",apply geiser:%s (%s)" proc (mapconcat 'identity args " ")))))
(defconst geiser-racket--module-re
"^(module +\\([^ ]+\\)")