From 0529e5a684e274eb27277329eb36d5b44f0a75d2 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Thu, 26 Sep 2013 19:08:19 +0200 Subject: Checking for versions before creating the REPL buffer ... so that we don't end up with a blank, useless buffer around. --- elisp/geiser-repl.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'elisp') diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index ebb74c2..995bb3b 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -340,8 +340,16 @@ module command as a string") txt) (geiser-autodoc--disinhibit-autodoc))) +(defun geiser-repl--check-version (impl) + (when (not geiser-repl-skip-version-check-p) + (let ((v (geiser-repl--version impl (geiser-repl--binary impl))) + (r (geiser-repl--min-version impl))) + (when (geiser--version< v r) + (error "Geiser requires %s version %s but detected %s" impl r v))))) + (defun geiser-repl--start-repl (impl address) (message "Starting Geiser REPL for %s ..." impl) + (when (not address) (geiser-repl--check-version impl)) (geiser-repl--to-repl-buffer impl) (sit-for 0) (goto-char (point-max)) @@ -372,13 +380,6 @@ module command as a string") geiser-repl-query-on-kill-p) (message "%s up and running!" (geiser-repl--repl-name impl)))) -(defun geiser-repl--check-version (impl) - (when (not geiser-repl-skip-version-check-p) - (let ((v (geiser-repl--version impl (geiser-repl--binary impl))) - (r (geiser-repl--min-version impl))) - (when (geiser--version< v r) - (error "Geiser requires %s version %s but detected %s" impl r v))))) - (defun geiser-repl--start-scheme (impl address prompt) (setq comint-prompt-regexp prompt) (let* ((name (geiser-repl--repl-name impl)) @@ -387,7 +388,6 @@ module command as a string") `(,(geiser-repl--binary impl) nil ,@(geiser-repl--arglist impl))))) - (when (not address) (geiser-repl--check-version impl)) (condition-case err (apply 'make-comint-in-buffer `(,name ,buff ,@args)) (error (insert "Unable to start REPL:\n" -- cgit v1.2.3