Function: cider-ns-edit--locate

cider-ns-edit--locate is a byte-compiled function defined in cider-ns.el.

Signature

(cider-ns-edit--locate NS-START KEYWORD PRED)

Documentation

Return where the first element PRED accepts is in a KEYWORD clause.

That's (CLAUSE INDEX POS): the start of the clause in the ns form at NS-START, the index of the element in it, which counts from the clause's head, and the start of the element. PRED gets the start of an element.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20261106.1225/cider-ns.el
(defun cider-ns-edit--locate (ns-start keyword pred)
  "Return where the first element PRED accepts is in a KEYWORD clause.
That's (CLAUSE INDEX POS): the start of the clause in the ns form at
NS-START, the index of the element in it, which counts from the clause's
head, and the start of the element.  PRED gets the start of an element."
  (seq-some (lambda (clause)
              (let ((elements (cider-ns-edit--elements clause)))
                (when-let* ((index (seq-position (cdr elements) nil
                                                 (lambda (pos _) (funcall pred pos)))))
                  (list clause (1+ index) (nth (1+ index) elements)))))
            (cider-ns-edit--clauses ns-start keyword)))