From 8368aced1d2ef98c79fb76e9cf58dc320ef89342 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 16 Mar 2009 02:56:11 +0100 Subject: Key for geiser-set-scheme in geiser-mode. --- elisp/geiser-impl.el | 32 +++++++++++++++----------------- elisp/geiser-mode.el | 2 ++ 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'elisp') 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) @@ -173,19 +184,6 @@ implementation to be used by Geiser.")) (throw 'impl impl)))) (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 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) -- cgit v1.2.3