Say what C-c C-i actually takes: the innermost thing, not the enclosing form

This commit is contained in:
Joseph Ferano 2026-09-20 18:17:48 +07:00
parent ce900acfe4
commit f4fcbe7745
2 changed files with 16 additions and 9 deletions

View File

@ -377,8 +377,10 @@ everything it had is still there.
## Looking at values
**`C-c C-i`** inspects a value: the expression point is on, with no prompt. You
get its fields, one per line. It takes the form point is *inside*, not merely
the one behind point, so the middle of a name works as well as the end of one.
get its fields, one per line. It takes the innermost thing point is on rather
than only the one behind point, so the middle of a name works as well as the end
of one — point anywhere in `enemies` takes `enemies`, and on the open paren of
`(len enemies)` takes the whole call.
**`C-u C-c C-i`** opens the minibuffer instead, pre-filled with whatever was at
point — for inspecting something that is not written in the buffer, or is

View File

@ -680,13 +680,18 @@ and whether that may be followed is the answer"))
(defun flan-inspect--expression-at-point ()
"The text of the expression point is on, or nil.
The form point is *in*, and not merely the one behind it: point in the middle
of a name is where a key pressed without looking lands, and `backward-sexp\='
alone answers with the half of the name already typed past which reads as
the command being broken rather than as point being one character early. So
the end of the thing under point is found first, and the form is taken back
from there; on an opening delimiter the form that opens there is taken
instead, which is the rule `flan-macroexpand\=' follows for the same reason.
The innermost thing point is on, and not merely the one behind it: point in
the middle of a name is where a key pressed without looking lands, and
`backward-sexp\=' alone answers with the half of the name already typed past
which reads as the command being broken rather than as point being one
character early. So the end of the thing under point is found first, and the
form is taken back from there; on an opening delimiter the form that opens
there is taken instead, which is the rule `flan-macroexpand\=' follows for the
same reason.
Innermost, so point on `enemies\=' inside `(len enemies)\=' takes `enemies\=' and
not the call which is the right answer for a command that shows you one
value, and the enclosing call is a paren away in either direction.
Nil when there is nothing there to take, which is a buffer position with no
form at it at all."