Variable: cider-form-targeting
cider-form-targeting is a customizable variable defined in
cider-util.el.
Value
preceding
Documentation
How commands locate the form they operate on.
preceding is the classic behavior: the target is the sexp before
point, so point must sit right after the form (like eval-last-sexp
in Emacs Lisp).
smart resolves the intended form from the cursor position: on an
opening delimiter it targets the form it opens, on a closing delimiter
the form it closes, inside an atom or string that atom, and otherwise
the sexp preceding point. It agrees with preceding at every position
where the preceding sexp is well-defined, and only differs where the
classic answer was surprising (e.g. point sitting on a delimiter).
Consulted by cider-eval-last-sexp, cider-macroexpand-1 and the rest
of the commands that operate on the preceding sexp.
This variable was added, or its default value changed, in cider version 2.0.0.
Source Code
;; Defined in ~/.emacs.d/elpa/cider-20260807.1133/cider-util.el
(defcustom cider-form-targeting 'preceding
"How commands locate the form they operate on.
`preceding' is the classic behavior: the target is the sexp before
point, so point must sit right after the form (like `eval-last-sexp'
in Emacs Lisp).
`smart' resolves the intended form from the cursor position: on an
opening delimiter it targets the form it opens, on a closing delimiter
the form it closes, inside an atom or string that atom, and otherwise
the sexp preceding point. It agrees with `preceding' at every position
where the preceding sexp is well-defined, and only differs where the
classic answer was surprising (e.g. point sitting on a delimiter).
Consulted by `cider-eval-last-sexp', `cider-macroexpand-1' and the rest
of the commands that operate on the preceding sexp."
:group 'cider
:type '(choice (const :tag "Classic: the sexp preceding point" preceding)
(const :tag "Smart: infer the form from the cursor position" smart))
:package-version '(cider . "2.0.0"))