From 419985a0ec49deba4c5d0d22dc8b396916af28c6 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 6 Mar 2011 16:28:20 +0100 Subject: 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. --- elisp/geiser-repl.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'elisp/geiser-repl.el') 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))))) -- cgit v1.2.3