Function: cider-repls

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

Signature

(cider-repls &optional TYPE ENSURE REQUIRED-OPS)

Documentation

Return cider REPLs of TYPE from the current session.

If TYPE is nil or multi, return all REPLs. If TYPE is a list of types, return only REPLs of type contained in the list. If ENSURE is non-nil, throw an error if no linked session exists. If REQUIRED-OPS is non-nil, filters out all the REPLs that do not support the designated ops.

Aliases

cider-connections

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-connection.el
(defun cider-repls (&optional type ensure required-ops)
  "Return cider REPLs of TYPE from the current session.
If TYPE is nil or multi, return all REPLs.  If TYPE is a list of types,
return only REPLs of type contained in the list.  If ENSURE is non-nil,
throw an error if no linked session exists.  If REQUIRED-OPS is non-nil,
filters out all the REPLs that do not support the designated ops."
  (let ((type (cond
               ((listp type)
                (mapcar #'cider-maybe-intern type))
               ((cider-maybe-intern type))))
        (repls (if cider-default-session
                   (if-let* ((session (sesman-session 'CIDER cider-default-session)))
                       (cdr session)
                     (message "Default CIDER session '%s' no longer exists, ignoring" cider-default-session)
                     nil)
                 (pcase cider-merge-sessions
                   ('host
                    (if ensure
                        (or (cider--extract-connections (cider--get-sessions-with-same-host
                                                         (sesman-current-session 'CIDER)
                                                         (sesman-current-sessions 'CIDER)))
                            (user-error "No linked %s sessions" 'CIDER))
                      (cider--extract-connections (cider--get-sessions-with-same-host
                                                   (sesman-current-session 'CIDER)
                                                   (sesman-current-sessions 'CIDER)))))
                   ('project
                    (if ensure
                        (or (cider--extract-connections (sesman-current-sessions 'CIDER))
                            (user-error "No linked %s sessions" 'CIDER))
                      (cider--extract-connections (sesman-current-sessions 'CIDER))))
                   (_ (cdr (if ensure
                               (sesman-ensure-session 'CIDER)
                             (sesman-current-session 'CIDER))))))))
    (or (seq-filter (lambda (b)
                      (unless
                          (cider-cljs-pending-p b)
                        (and (cider--match-repl-type type b)
                             (seq-every-p (lambda (op)
                                            (nrepl-op-supported-p op b))
                                          required-ops))))
                    repls)
        (when ensure
          (cider--no-repls-user-error type)))))