unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Helmut Eller <eller.helmut@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 15101@debbugs.gnu.org
Subject: bug#15101: 24.3.50; debugger-eval-expression broken
Date: Thu, 15 Aug 2013 19:16:10 +0200	[thread overview]
Message-ID: <m24naqswmd.fsf@gmail.com> (raw)
In-Reply-To: <jwvsiybf23y.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 15 Aug 2013 10:45:52 -0400")

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





  parent reply	other threads:[~2013-08-15 17:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15 11:39 bug#15101: 24.3.50; debugger-eval-expression broken Helmut Eller
2013-08-15 14:45 ` Stefan Monnier
2013-08-15 15:06   ` Drew Adams
2013-08-15 16:37     ` Stefan Monnier
2013-08-15 17:03       ` Drew Adams
2013-08-15 17:16   ` Helmut Eller [this message]
2013-08-15 20:30     ` Stefan Monnier
2013-08-16  5:27       ` Helmut Eller
2013-08-16 16:14         ` Stefan Monnier
2013-08-16 17:03           ` Helmut Eller
2013-08-15 17:21   ` Stefan Monnier
2013-08-15 17:47     ` Drew Adams
2013-08-15 20:27       ` Stefan Monnier
2013-08-15 21:12         ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m24naqswmd.fsf@gmail.com \
    --to=eller.helmut@gmail.com \
    --cc=15101@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).