Function: clojure--substitute-fn-literal-arg

clojure--substitute-fn-literal-arg is a byte-compiled function defined in clojure-mode.el.

Signature

(clojure--substitute-fn-literal-arg ARG SUB END)

Documentation

ARG is either a number or the symbol '&.

SUB is a string to substitute with, and END marks the end of the fn expression

Source Code

;; Defined in ~/.emacs.d/elpa/clojure-mode-20260325.811/clojure-mode.el
(defun clojure--substitute-fn-literal-arg (arg sub end)
  "ARG is either a number or the symbol '&.
SUB is a string to substitute with, and
END marks the end of the fn expression"
  (save-excursion
    (let ((rgx (format "\\_<%%%s\\_>" (if (eq arg 1) "1?" arg))))
      (while (re-search-forward rgx end 'noerror)
        (when (and (not (clojure--in-comment-p))
                   (not (clojure--in-string-p)))
          (replace-match sub))))))