From 5b1bed8d4c3fda62e2f6dede7a1aa9a7f9505838 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 27 Jun 2010 14:44:16 +0200 Subject: Better switch/import REPL commands. --- elisp/geiser-guile.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3