summaryrefslogtreecommitdiff
path: root/elisp/geiser-repl.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2011-03-06 16:28:20 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2011-03-06 16:28:20 +0100
commit419985a0ec49deba4c5d0d22dc8b396916af28c6 (patch)
treeca3c3e4075659068d3822ec0e36cef287a6e48e6 /elisp/geiser-repl.el
parent5556754a5a384857a88651b449c77fd83dd1496d (diff)
downloadgeiser-chez-419985a0ec49deba4c5d0d22dc8b396916af28c6.tar.gz
geiser-chez-419985a0ec49deba4c5d0d22dc8b396916af28c6.tar.bz2
Bug fix: don't confuse REPL buffers
We were not checking the implementation associated to a REPL buffer when reusing it, with much confusion ensued.
Diffstat (limited to 'elisp/geiser-repl.el')
-rw-r--r--elisp/geiser-repl.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el
index e88287c..74a1207 100644
--- a/elisp/geiser-repl.el
+++ b/elisp/geiser-repl.el
@@ -184,6 +184,9 @@ module command as a string")
(defsubst geiser-repl--repl-name (impl)
(format "%s REPL" (geiser-impl--impl-str impl)))
+(defsubst geiser-repl--buffer-name (impl)
+ (format "* %s *" (geiser-repl--repl-name impl)))
+
(defun geiser-repl--switch-to-buffer (buffer)
(unless (eq buffer (current-buffer))
(let ((pop-up-windows geiser-repl-window-allow-split))
@@ -193,15 +196,14 @@ module command as a string")
(defun geiser-repl--to-repl-buffer (impl)
(unless (and (eq major-mode 'geiser-repl-mode)
+ (eq geiser-impl--implementation impl)
(not (get-buffer-process (current-buffer))))
(let* ((old (geiser-repl--repl/impl impl geiser-repl--closed-repls))
(old (and (buffer-live-p old)
(not (get-buffer-process old))
old)))
(geiser-repl--switch-to-buffer
- (or old
- (generate-new-buffer (format "* %s *"
- (geiser-repl--repl-name impl)))))
+ (or old (generate-new-buffer (geiser-repl--buffer-name impl))))
(unless old
(geiser-repl-mode)
(geiser-impl--set-buffer-implementation impl)))))