Function: clojure--search-letfn-name

clojure--search-letfn-name is a byte-compiled function defined in clojure-mode.el.

Signature

(clojure--search-letfn-name LIMIT)

Documentation

Search for function names in letfn bindings up to LIMIT.

This is a font-lock MATCHER function that finds each binding name in a letfn binding vector. For each (symbol match, it checks whether the paren is a direct child of a letfn binding vector.

Source Code

;; Defined in ~/.emacs.d/elpa/clojure-mode-20260325.811/clojure-mode.el
(defun clojure--search-letfn-name (limit)
  "Search for function names in letfn bindings up to LIMIT.
This is a font-lock MATCHER function that finds each binding name
in a `letfn' binding vector.  For each `(symbol' match, it checks
whether the paren is a direct child of a letfn binding vector."
  (let ((binding-re (concat "(\\(" clojure--sym-regexp "\\)"))
        found)
    (while (and (not found)
                (re-search-forward binding-re limit t))
      ;; `save-match-data' is critical: the verification below uses
      ;; `looking-back' which would overwrite the match data from
      ;; `re-search-forward' that font-lock needs for the highlight.
      (save-match-data
        (let ((paren-pos (match-beginning 0)))
          (save-excursion
            (goto-char paren-pos)
            (when (ignore-errors (backward-up-list) t)
              (when (eq (char-after) ?\[)
                (skip-chars-backward " \t\n\r")
                (when (looking-back
                       "(\\(?:clojure\\.core/\\)?letfn"
                       (- (point) 25))
                  (setq found t))))))))
    found))