Function: cider-ns-add-require
cider-ns-add-require is an autoloaded, interactive and byte-compiled
function defined in cider-ns.el.
Signature
(cider-ns-add-require NS &optional ALIAS)
Documentation
Add NS to the :require clause of the buffer's ns form.
With ALIAS, require NS as [NS :as ALIAS]. The clause gets created when it's missing. When NS is already required, ALIAS gets added to its libspec if that has no alias. Another alias for NS, or ALIAS belonging to another namespace, is an error.
Interactively, prompt for NS, completing over the namespaces loaded in the REPL when connected, then for ALIAS, which starts out as the last segment of NS. Clear it to require NS without an alias.
After a change, do what cider-ns-edit-actions asks for.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/cider-20261106.1225/cider-ns.el
;;;###autoload
(defun cider-ns-add-require (ns &optional alias)
"Add NS to the :require clause of the buffer's ns form.
With ALIAS, require NS as [NS :as ALIAS]. The clause gets created when
it's missing. When NS is already required, ALIAS gets added to its
libspec if that has no alias. Another alias for NS, or ALIAS belonging
to another namespace, is an error.
Interactively, prompt for NS, completing over the namespaces loaded in
the REPL when connected, then for ALIAS, which starts out as the last
segment of NS. Clear it to require NS without an alias.
After a change, do what `cider-ns-edit-actions' asks for."
(interactive
(progn
(cider-ns-edit--check)
(let ((ns (string-trim (cider-ns-edit--read-ns))))
(when (string-empty-p ns)
(user-error "No namespace given"))
(let ((alias (string-trim
(read-string (format "Alias for %s (empty for none): " ns)
(cider-ns-edit--default-alias ns)))))
(list ns (unless (string-empty-p alias) alias))))))
(when (string-empty-p ns)
(user-error "No namespace given"))
(pcase-let ((`(,status . ,libspec)
(cider-ns-edit--edit
(lambda (start) (cider-ns-edit--add-require start ns alias)))))
(cider-ns-edit--require-message ns status libspec)))