[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#15101: 24.3.50; debugger-eval-expression broken
From: |
Helmut Eller |
Subject: |
bug#15101: 24.3.50; debugger-eval-expression broken |
Date: |
Thu, 15 Aug 2013 19:16:10 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
On Thu, Aug 15 2013, Stefan Monnier wrote:
>> Start Emacs with: emacs -Q --eval '(let ((foo 123)) (debug))'
>> Then press e. Enter foo to evaluate the local variable foo. But it
>> doesn't work; it only generates the error:
>> debugger-eval-expression: Symbol's value as variable is void: foo
>> This used to work fine in previous versions.
>
> Indeed, this is a change that will trip up users. Here's what's
> happening: `e' will now run the code in the context in which the "code
> on the current line" was run.
>
> This refinement can be useful for dynamically bound variables, but was
> mostly added for lexically bound variables, where it's indispensable.
>
> So the above recipe works again if you use C-p before `e' so that point
> is now on the top-most line, which stands for "in the context that
> called `debug'".
>
> I think a good fix is to change debug.el so that point starts on the
> first line of the *Debugger* buffer rather than on the second.
What does "context" mean? Intuitively I would say that in the second
line, ie. the one that looks like "(let ((foo 123)) (debug))", foo is
part of the context.
Compare this with:
(let ((foo 1))
(let ((bar 2))
(let ((baz 3))
(debug))))
It seems to me that a better fix would be to adjust linenumber->context
mapping by one.
Helmut
bug#15101: 24.3.50; debugger-eval-expression broken, Stefan Monnier, 2013/08/15