Function: cider--connection-info

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

Signature

(cider--connection-info CONNECTION-BUFFER &optional GENERICP)

Documentation

Return info about CONNECTION-BUFFER.

Info contains project name, current REPL namespace, host:port endpoint and runtime details. When GENERICP is non-nil, don't provide specific info about this buffer (like variable cider-repl-type(var)/cider-repl-type(fun)).

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-connection.el
(defun cider--connection-info (connection-buffer &optional genericp)
  "Return info about CONNECTION-BUFFER.
Info contains project name, current REPL namespace, host:port endpoint and
runtime details.  When GENERICP is non-nil, don't provide specific info
about this buffer (like variable `cider-repl-type')."
  (with-current-buffer connection-buffer
    (let ((info (cond
                 ((cider--clojure-version)
                  (format "%s%s@%s:%s (Java %s, Clojure %s, nREPL %s)"
                          (if genericp "" (upcase (concat (symbol-name cider-repl-type) " ")))
                          (or (cider--project-name nrepl-project-dir) "<no project>")
                          (plist-get nrepl-endpoint :host)
                          (plist-get nrepl-endpoint :port)
                          (cider--java-version)
                          (cider--clojure-version)
                          (cider--nrepl-version)))
                 ((cider--babashka-version)
                  (format "%s%s@%s:%s (Babashka %s, babashka.nrepl %s)"
                          (if genericp "" (upcase (concat (symbol-name cider-repl-type) " ")))
                          (or (cider--project-name nrepl-project-dir) "<no project>")
                          (plist-get nrepl-endpoint :host)
                          (plist-get nrepl-endpoint :port)
                          (cider--babashka-version)
                          (cider--babashka-nrepl-version)))
                 (t
                  (format "%s%s@%s:%s"
                          (if genericp "" (upcase (concat (symbol-name cider-repl-type) " ")))
                          (or (cider--project-name nrepl-project-dir) "<no project>")
                          (plist-get nrepl-endpoint :host)
                          (plist-get nrepl-endpoint :port))))))
      (if cider-default-session
          (format "%s [default session: %s]" info cider-default-session)
        info))))