Subject: RE: bug#15101: 24.3.50; debugger-eval-expression broken

From: Drew Adams <[email-masked]>
Date: Thu, 15 Aug 2013 10:03:46 -0700 (PDT)

> > In your judgment, can both the old `e' behavior and the new `e'
> > behavior be useful, at least for dynamically bound variables?
> 
> `e' while on the top line of the buffer gives you the old behavior
> (except it handles lexical vars if there were any when `debug' was
> called).

Yes, you said that.  This should be documented, of course, especially
since previously the cursor position was irrelevant for `e'.  So there
is at least a doc bug here, it seems.

You say that "this refinement can be useful for dynamically bound
variables" and is "indispensable" for lexically bound vars.

OK.  So just what is the usefulness?  What is a use case for `e' with
point not on the first line?  That too should be pointed out in the
doc - not obvious to me, at least.

And if it is NOT useful for someone to use `e' anywhere other than the
first line then why not have `e' act as if it were at bob?

Or if it is sometimes, but not typically, useful to use `e' other than
on the first line, how about a message letting an unaware user know that
the cursor is not on the first line and hence evaluation will not be in
the "context that called `debug'"?  That seems the least we could do
about this gotcha.

In sum, my concerns here are:

1. Is the non-first-line behavior of `e' really useful?  If not, maybe
   have the code work around it (always act as if on the first line).

2. Document the behavior (completely).  Describe the different use cases.

3. Consider a message informing the user that, because point is not
   on the first line, evaluation will not be done in the original context
   (and tell the user just what evaluation context will be used).

AFAICT, there is no mention of this in the doc yet.  I see that "lexical"
is mentioned only briefly in (elisp) `Edebug Eval' - and nothing about
this.  And it is not mentioned at all in the manual sections about the
standard, non-edebug debugger (i.e., command `debug').