summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-06-27 14:44:16 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-06-27 14:44:16 +0200
commit5b1bed8d4c3fda62e2f6dede7a1aa9a7f9505838 (patch)
treef796df5256815850be8a209e3c4d40697b0a89f3
parent044c88e5396381ae0130b2907d393079474b4eb5 (diff)
downloadgeiser-guile-5b1bed8d4c3fda62e2f6dede7a1aa9a7f9505838.tar.gz
geiser-guile-5b1bed8d4c3fda62e2f6dede7a1aa9a7f9505838.tar.bz2
Better switch/import REPL commands.
-rw-r--r--elisp/geiser-guile.el13
1 files changed, 12 insertions, 1 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index cfcba80..fb49085 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -90,8 +90,18 @@ This function uses `geiser-guile-init-file' if it exists."
(car (geiser-syntax--read-from-string module))) :f))
(t :f)))
+(defun geiser-guile--module-cmd (module fmt &optional def)
+ (when module
+ (let* ((module (geiser-guile--get-module module))
+ (module (cond ((or (null module) (eq module :f)) def)
+ (t (format "%s" module)))))
+ (and module (format fmt module)))))
+
+(defun geiser-guile--import-command (module)
+ (geiser-guile--module-cmd module ",i %s"))
+
(defun geiser-guile--enter-command (module)
- (and module (format ",m %s" (geiser-guile--get-module module))))
+ (geiser-guile--module-cmd module ",m %s" "(guile-user)"))
(defun geiser-guile--symbol-begin (module)
(if module
@@ -204,6 +214,7 @@ This function uses `geiser-guile-init-file' if it exists."
(marshall-procedure geiser-guile--geiser-procedure)
(find-module geiser-guile--get-module)
(enter-command geiser-guile--enter-command)
+ (import-command geiser-guile--import-command)
(find-symbol-begin geiser-guile--symbol-begin)
(display-error geiser-guile--display-error)
(display-help)