From f4fcbe774571dfabcc61e73f0c0b2688ca5d76a3 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 20 Sep 2026 18:17:48 +0700 Subject: [PATCH] Say what C-c C-i actually takes: the innermost thing, not the enclosing form --- emacs/MANUAL.md | 6 ++++-- emacs/flan-inspect.el | 19 ++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/emacs/MANUAL.md b/emacs/MANUAL.md index e59ff96..09b6c1d 100644 --- a/emacs/MANUAL.md +++ b/emacs/MANUAL.md @@ -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 diff --git a/emacs/flan-inspect.el b/emacs/flan-inspect.el index d876dbe..2e76e0a 100644 --- a/emacs/flan-inspect.el +++ b/emacs/flan-inspect.el @@ -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."