diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-06-27 14:44:16 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2010-06-27 14:44:16 +0200 |
commit | 9ef09ff72b8c8a015b38a30334b00cb4cea15158 (patch) | |
tree | 3473601e47905c05cb0a28dc1bcc8cd8c470debd /elisp/geiser-racket.el | |
parent | eab369930516ece1d40658b891f4629d6f9ed8ac (diff) | |
download | geiser-guile-9ef09ff72b8c8a015b38a30334b00cb4cea15158.tar.gz geiser-guile-9ef09ff72b8c8a015b38a30334b00cb4cea15158.tar.bz2 |
Better switch/import REPL commands.
Diffstat (limited to 'elisp/geiser-racket.el')
-rw-r--r-- | elisp/geiser-racket.el | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/elisp/geiser-racket.el b/elisp/geiser-racket.el index e5f8780..7f00810 100644 --- a/elisp/geiser-racket.el +++ b/elisp/geiser-racket.el @@ -113,7 +113,15 @@ This function uses `geiser-racket-init-file' if it exists." (save-excursion (skip-syntax-backward "^-()>") (point))) (defun geiser-racket--enter-command (module) - (and (stringp module) (format "(enter! (file %S))" module))) + (when (stringp module) + (cond ((zerop (length module)) "(enter! #f)") + ((file-name-absolute-p module) (format "(enter! (file %S))" module)) + (t (format "(enter! %s)" module))))) + +(defun geiser-racket--import-command (module) + (and (stringp module) + (not (zerop (length module))) + (format "(require %s)" module))) (defconst geiser-racket--binding-forms '(for for/list for/hash for/hasheq for/and for/or @@ -192,6 +200,7 @@ This function uses `geiser-racket-init-file' if it exists." (marshall-procedure geiser-racket--geiser-procedure) (find-module geiser-racket--get-module) (enter-command geiser-racket--enter-command) + (import-command geiser-racket--import-command) (find-symbol-begin geiser-racket--symbol-begin) (display-error geiser-racket--display-error) (display-help geiser-racket--external-help) |