          (buffer (gethash key +eval-repl-buffers)))
     (cl-check-type buffer (or buffer null))
     (unless (eq buffer (current-buffer))
-      (funcall (if other-window-p #'pop-to-buffer #'switch-to-buffer)
+      (funcall (or displayfn #'get-buffer-create)
                (if (buffer-live-p buffer)
                    buffer
                  (setq buffer

                         repl))))))
    (unless (commandp command)
      (error "Couldn't find a valid REPL for %s" major-mode))
    (when (+eval--ensure-in-repl-buffer command other-window-p)
      (when (bound-and-true-p evil-mode)
        (call-interactively #'evil-append-line))
      t)))

;;;###autoload

                     (point-max))))
      buffer)))

(defun +eval-open-repl (prompt-p &optional displayfn)
  (let ((command (cdr (assq major-mode +eval-repls)))
        (region (if (use-region-p)
                    (buffer-substring-no-properties (region-beginning)
                                                    (region-end)))))
    (when (or (not command) prompt-p)
      (let* ((choices (or (cl-loop for sym being the symbols
                                   for sym-name = (symbol-name sym)
