diff options
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | elisp/geiser-impl.el | 32 | ||||
-rw-r--r-- | elisp/geiser-mode.el | 2 |
3 files changed, 18 insertions, 17 deletions
@@ -21,6 +21,7 @@ |------------------+-------------------------------------------------| | C-cC-z | Switch to REPL | + | C-cC-s | Specify Scheme implementation for buffer | |------------------+-------------------------------------------------| | M-. | Edit symbol at point | | M-, | Go back to where M-. was last invoked | 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) |