Function: cider--switch-to-repl-buffer

cider--switch-to-repl-buffer is a byte-compiled function defined in cider-mode.el.

Signature

(cider--switch-to-repl-buffer REPL-BUFFER &optional SET-NAMESPACE)

Documentation

Select the REPL-BUFFER, when possible in an existing window.

When SET-NAMESPACE is t, sets the namespace in the REPL buffer to that of the namespace in the Clojure source buffer.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-mode.el
;;; Switching between REPL & source buffers

(defun cider--switch-to-repl-buffer (repl-buffer &optional set-namespace)
  "Select the REPL-BUFFER, when possible in an existing window.
When SET-NAMESPACE is t, sets the namespace in the REPL buffer to
that of the namespace in the Clojure source buffer."
  (let ((buffer (current-buffer)))
    ;; first we switch to the REPL buffer
    (if cider-repl-display-in-current-window
        (pop-to-buffer-same-window repl-buffer)
      (pop-to-buffer repl-buffer))
    ;; then if necessary we update its namespace
    (when set-namespace
      (cider-repl-set-ns (with-current-buffer buffer (cider-current-ns))))
    (goto-char (point-max))))