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
commit097811c953284f1c676de8ceee45a70f0b4e64a7 (patch)
treef7ee1cb291b3880c8c944b0d79cbbf08c1e43ea5
parent14c436f5f8d73fe80da40eda382c7a76aacb3ef1 (diff)
downloadgeiser-097811c953284f1c676de8ceee45a70f0b4e64a7.tar.gz
geiser-097811c953284f1c676de8ceee45a70f0b4e64a7.tar.bz2
Better switch/import REPL commands.
-rw-r--r--elisp/geiser-repl.el17
1 files changed, 16 insertions, 1 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index 3e52361..c9f3d26 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -251,6 +251,21 @@ module command as a string")
(switch-to-geiser)
(geiser-repl--send cmd)))
+(geiser-impl--define-caller geiser-repl--import-cmd import-command (module)
+ "Function taking a module designator and returning a REPL import
+module command as a string")
+
+(defun geiser-repl-import-module (&optional module)
+ "Import a given module in the current namespace."
+ (interactive)
+ (let* ((module (or module
+ (geiser-completion--read-module "Import module: ")))
+ (cmd (and module
+ (geiser-repl--import-cmd geiser-impl--implementation
+ module))))
+ (switch-to-geiser)
+ (geiser-repl--send cmd)))
+
(defun geiser-repl-nuke ()
"Try this command if the REPL becomes unresponsive."
(interactive)
@@ -395,7 +410,7 @@ module command as a string")
:enable (symbol-at-point))
--
("Switch to module..." ("\C-c\C-m" "\C-cm") switch-to-geiser-module)
- ("Load module" ("\C-c\C-l" "\C-cl") geiser-load-file)
+ ("Import module" ("\C-c\C-i" "\C-ci") geiser-repl-import-module)
--
("Previous matching input" "\M-p" comint-previous-matching-input-from-input
"Previous input matching current")