Subject: 31.0.50; Local variable names missing from 'setq' argument completions

From: Eshel Yaron <[email-masked]>
Date: Sat, 15 Feb 2025 17:19:19 +0100

Hi,

Local variable name completion in ELisp seems to fail at uneven setq
argument positions:

1. emacs -Q
2. Permit local variables analysis in scratch buffer by evaluating
   (setq-local trusted-content :all)
3. Insert:
   (defun foo (barbaz) bar)
4. Place point after "bar" and hit C-M-i
5. See "bar" completed to "barbaz", as expected
6. Now insert instead:
   (defun foo (barbaz) (setq bar))
7. Again with point after "bar", hit C-M-i
8. Emacs reports "no match" instead of completing to "barbaz"

This used to work as expected in Emacs 28, but not in 29, 30 or master.

Regards,

Eshel