diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-16 02:56:11 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-03-16 02:56:11 +0100 |
commit | 8368aced1d2ef98c79fb76e9cf58dc320ef89342 (patch) | |
tree | 02aef2043a99ac86d8cc63f114af5eec71681132 /elisp | |
parent | bf174c102bb46362c78d079eaccbc14f3581d0c6 (diff) | |
download | geiser-8368aced1d2ef98c79fb76e9cf58dc320ef89342.tar.gz geiser-8368aced1d2ef98c79fb76e9cf58dc320ef89342.tar.bz2 |
Key for geiser-set-scheme in geiser-mode.
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-impl.el | 32 | ||||
-rw-r--r-- | elisp/geiser-mode.el | 2 |
2 files changed, 17 insertions, 17 deletions
diff --git a/elisp/geiser-impl.el b/elisp/geiser-impl.el index 2cec381..cdda479 100644 --- a/elisp/geiser-impl.el +++ b/elisp/geiser-impl.el @@ -35,7 +35,7 @@ "Generic support for multiple Scheme implementations." :group 'geiser) -(defcustom geiser-impl-default-implementation 'guile +(defcustom geiser-impl-default-implementation nil "Symbol naming the default Scheme implementation." :type 'symbol :group 'geiser-impl) @@ -64,19 +64,30 @@ (let ((impl (or impl geiser-impl--implementation))) (and impl (capitalize (format "%s" impl))))) +(defsubst geiser-impl--impl-feature (impl) + (intern (format "geiser-%s" impl))) + ;;; Installing Scheme implementations: (make-variable-buffer-local (defvar geiser-impl--implementation nil)) -(defsubst geiser-impl--impl-feature (impl) - (intern (format "geiser-%s" impl))) +(defvar geiser-impl--impl-prompt-history nil) + +(defun geiser-impl--read-impl (&optional prompt impls non-req) + (let* ((impls (or impls geiser-impl--impls)) + (impls (mapcar (lambda (s) (format "%s" s)) impls)) + (prompt (or prompt "Scheme implementation: "))) + (intern (completing-read prompt impls nil (not non-req) nil + geiser-impl--impl-prompt-history + (and (car geiser-impl--impls) + (symbol-name (car geiser-impl--impls))))))) (defun geiser-impl--set-buffer-implementation (&optional impl) (let ((impl (or impl (geiser-impl--guess) - (intern (read-string "Scheme implementation: "))))) + (geiser-impl--read-impl nil nil t)))) (require (geiser-impl--impl-feature impl)) (setq geiser-impl--implementation impl) (geiser-impl--install-eval impl) @@ -174,19 +185,6 @@ implementation to be used by Geiser.")) (geiser-impl--default-implementation))) -;;; User commands: -(defvar geiser-impl--impl-prompt-history nil) - -(defun geiser-impl--read-impl (&optional prompt impls) - (let* ((impls (or impls geiser-impl--impls)) - (impls (mapcar (lambda (s) (format "%s" s)) impls)) - (prompt (or prompt "Scheme implementation: "))) - (intern (completing-read prompt impls nil t nil - geiser-impl--impl-prompt-history - (and (car geiser-impl--impls) - (symbol-name (car geiser-impl--impls))))))) - - ;;; Unload support (defun geiser-impl-unload-function () diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el index 3e9e3c1..3a57ec7 100644 --- a/elisp/geiser-mode.el +++ b/elisp/geiser-mode.el @@ -189,6 +189,8 @@ interacting with the Geiser REPL is at your disposal. (define-key geiser-mode-map (vector '(control ?c) `(control ,p) `(control ,k)) c)) (define-key geiser-mode-map "\C-c\C-z" 'switch-to-geiser) +(define-key geiser-mode-map "\C-c\C-s" 'geiser-set-scheme) + (define-key geiser-mode-map "\C-c\C-l" 'geiser-load-current-buffer) (define-key geiser-mode-map "\C-c\C-k" 'geiser-compile-current-buffer) |