Function: cider-jack-in-universal
cider-jack-in-universal is an autoloaded, interactive and
byte-compiled function defined in cider-jack-in.el.
Signature
(cider-jack-in-universal ARG)
Documentation
Start and connect to an nREPL server for the current project or ARG project id.
If a project is found in current dir, call cider-jack-in passing ARG as
first parameter, of which see. Otherwise, ask user which project type to
start an nREPL server and connect to without a project.
But if invoked with a numeric prefix ARG, then start an nREPL server for the project type denoted by ARG number and connect to it, even if there is no project for it in the current dir.
The supported project tools are those in cider-jack-in-tools that have a
:dispatch-prefix-arg key.
You can pass a numeric prefix argument n with `M-n` or `C-u n`.
For example, to jack in to leiningen which is assigned to prefix arg 2 type
M-2 M-x cider-jack-in-universal (cider-jack-in-universal).
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-jack-in.el
;;;###autoload
(defun cider-jack-in-universal (arg)
"Start and connect to an nREPL server for the current project or ARG project id.
If a project is found in current dir, call `cider-jack-in' passing ARG as
first parameter, of which see. Otherwise, ask user which project type to
start an nREPL server and connect to without a project.
But if invoked with a numeric prefix ARG, then start an nREPL server for
the project type denoted by ARG number and connect to it, even if there is
no project for it in the current dir.
The supported project tools are those in `cider-jack-in-tools' that have a
:dispatch-prefix-arg key.
You can pass a numeric prefix argument n with `M-n` or `C-u n`.
For example, to jack in to leiningen which is assigned to prefix arg 2 type
M-2 \\[cider-jack-in-universal]."
(interactive "P")
(let ((cpt (cider-project-dir (cider-current-dir))))
(if (or (integerp arg) (null cpt))
(let* ((tools (cider--universal-jack-in-tools))
(project-type
(cond
((null arg)
(intern (completing-read
"No project found in current dir, select project type to jack in: "
(mapcar #'car tools) nil t)))
(t
(or (car (seq-find (lambda (entry)
(eql arg (plist-get (cdr entry) :dispatch-prefix-arg)))
tools))
(error ":cider-jack-in-universal :unsupported-prefix-argument %S :no-such-project"
arg)))))
(opts (cider--universal-jack-in-opts project-type))
(jack-in-type (or (plist-get (cider--jack-in-tool project-type) :jack-in-type)
'clj)))
(pcase jack-in-type
('clj (cider-jack-in-clj opts))
('cljs (cider-jack-in-cljs opts))
(_ (error ":cider-jack-in-universal :jack-in-type-unsupported %S" jack-in-type))))
(cider-jack-in-clj arg))))