From 240bf0679c5f1f39122526c5bdde67cc10c8236c Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Wed, 8 Oct 2025 15:46:45 +0200 Subject: [PATCH] ; * lisp/emacs-lisp/elisp-scope.el (if-let*): Add comment. --- lisp/emacs-lisp/elisp-scope.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/emacs-lisp/elisp-scope.el b/lisp/emacs-lisp/elisp-scope.el index f689f4bb34f..3a695f4001a 100644 --- a/lisp/emacs-lisp/elisp-scope.el +++ b/lisp/emacs-lisp/elisp-scope.el @@ -2258,6 +2258,12 @@ property, or if the current buffer is trusted (see `trusted-content-p')." (elisp-scope-1 file '(symbol . feature)) (elisp-scope-1 form 'code)) +;; We use a bespoke analyzer for `if-let*' instead of letting +;; `elisp-scope-1' expand it because `if-let*' expands to a form that +;; uses each binding symbol also as a bound symbol, and hence after +;; macro-expansion, we would analyze the same symbol(-with-position) +;; first as a `binding-variable' and then as `bound-variable'. With +;; this bespoke analyzer, we only analyze it as a `binding-variable'. (elisp-scope-define-macro-analyzer if-let* (&optional varlist then &rest else) (elisp-scope-if-let varlist then else elisp-scope-output-spec))