From 39e15056832d9136d05c26bc04a96a1f549669cf Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 6 May 2026 15:24:53 +0200 Subject: [PATCH] ; Expand 'elisp-fontify-symbol' and 'elisp-scope-analyze-form' docs See discussion at https://yhetil.org/emacs/868q9wag3h.fsf@gnu.org/ * lisp/progmodes/elisp-mode.el (elisp-fontify-symbol): * lisp/emacs-lisp/elisp-scope.el (elisp-scope-analyze-form): Expand docstring. --- lisp/emacs-lisp/elisp-scope.el | 4 ++++ lisp/progmodes/elisp-mode.el | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/elisp-scope.el b/lisp/emacs-lisp/elisp-scope.el index 1dad4a558a3..7f66e277b2f 100644 --- a/lisp/emacs-lisp/elisp-scope.el +++ b/lisp/emacs-lisp/elisp-scope.el @@ -2828,6 +2828,10 @@ is locally defined, or nil. If SYM is itself a binding occurrence, then POS and DEF are equal. If SYM is not lexically bound, then DEF is nil and so is ID. +CALLBACK should use ID by checking if it is nil or `equal' to other ID +values produced in the same call to this function. The specific value +of a given ID is otherwise meaningless. + As an example, when this function analyzes the following form (lambda (mode) (let ((mode (or mode major-mode))) (symbol-name mode))) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 6ccbe14f265..5a550b33016 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -618,7 +618,9 @@ semantic highlighting takes precedence." If `elisp-add-help-echo' is non-nil, also annotate the symbol with the `help-echo' text property. If `cursor-sensor-mode' is enabled and ID is -non-nil, also annotate the symbol with `cursor-sensor-functions'. +non-nil (i.e. SYM is local variable), also annotate the symbol with +`cursor-sensor-functions' that highlight all occurrences of SYM with the +same ID whenever point is on this SYM. For the precise meaning of the arguments of this function, see the docstring of `elisp-scope-analyze-form'. This function is intended for