Function: cider--include-leading-metadata

cider--include-leading-metadata is a byte-compiled function defined in cider-util.el.

Signature

(cider--include-leading-metadata B)

Documentation

Extend the bounds cons B backwards over leading ^metadata, if any.

The thing-at-point machinery doesn't know Clojure metadata belongs to the form it annotates; clojure-backward-logical-sexp does.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-util.el
;;; sexp navigation
(defun cider--include-leading-metadata (b)
  "Extend the bounds cons B backwards over leading ^metadata, if any.
The `thing-at-point' machinery doesn't know Clojure metadata belongs to
the form it annotates; `clojure-backward-logical-sexp' does."
  (let ((logical-start (ignore-errors
                         (save-excursion
                           (goto-char (cdr b))
                           (clojure-backward-logical-sexp 1)
                           (point)))))
    (if (and logical-start
             (< logical-start (car b))
             (eq (char-after logical-start) ?^))
        (cons logical-start (cdr b))
      b)))