Subject: Re: bug#59213: Emacs 29: Edebug fails to instrument a parameter whose name begins with _

From: Michael Heerdegen <[email-masked]>
Date: Mon, 14 Nov 2022 03:48:45 +0100

Alan Mackenzie <[email-masked]> writes:

> During the edebug session, I attempted
>
>     e _old-len RET.
>
> Instead of giving me the value of _old-len (which was 3) it gave the
> error message
>
>     Error: Symbol's value as variable is void: _old-len

Here is a test case:

(defun test (a b _c)
  (+ a b))

Instrument, etc., and e _c RET gives you the void variable error.

I don't think this behavior is intended.

When I change

(defun edebug-eval (expr)
  (backtrace-eval expr 0 'edebug-after))

to

(defun edebug-eval (expr)
  (backtrace-eval expr 1 'edebug-after))
;;                     ^

a binding of _c is being printed.  Let's CC Stefan who is the real
expert and ask whether this change would make sense.  I'm not sure when
and in which frames a binding is or should be visible.  Note: when _c is
used in the function body a binding _is_ visible also in the 0th frame.

Michael.