Function: cider--connected-handler

cider--connected-handler is a byte-compiled function defined in cider-connection.el.

Signature

(cider--connected-handler)

Documentation

Handle CIDER initialization after nREPL connection has been established.

This function is appended to nrepl-connected-hook in the client process buffer.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-connection.el
(defun cider--connected-handler ()
  "Handle CIDER initialization after nREPL connection has been established.
This function is appended to `nrepl-connected-hook' in the client process
buffer."
  ;; `nrepl-connected-hook' is run in the connection buffer
  ;; `cider-enlighten-mode' changes eval to include the debugger, so we inhibit
  ;; it here as the debugger isn't necessarily initialized yet
  (let ((cider-enlighten-mode nil))
    ;; after initialization, set mode-line and buffer name.
    (cider-set-repl-type cider-repl-type)
    (cider-repl-init
     (current-buffer)
     (lambda ()
       ;; Init logic that's specific to Clojure's nREPL and cider-nrepl
       (when (cider-runtime-clojure-p)
         (cider--check-required-nrepl-version)
         (cider--check-clojure-version-supported)
         (cider--check-middleware-compatibility)

         ;; Redirect the nREPL's terminal output to a REPL buffer.
         ;; If we don't do this the server's output will end up
         ;; in the *nrepl-server* buffer.
         (when (and cider-redirect-server-output-to-repl
                    (cider-nrepl-op-supported-p "out-subscribe"))
           (cider--subscribe-repl-to-server-out))

         ;; Middleware on cider-nrepl's side is deferred until first usage, but
         ;; loading middleware concurrently can lead to occasional "require" issues
         ;; (likely a Clojure bug). Thus, we load the heavy debug middleware towards
         ;; the end, allowing for the faster "server-out" middleware to load
         ;; first.
         (cider--debug-init-connection))

       (cider--set-connection-capabilities)

       (when cider-repl-init-function
         (funcall cider-repl-init-function))

       (when cider-auto-mode
         (cider-enable-on-existing-clojure-buffers))

       (run-hooks 'cider-connected-hook)))))