From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.bugs Subject: bug#15101: 24.3.50; debugger-eval-expression broken Date: Thu, 15 Aug 2013 19:16:10 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376587047 13262 80.91.229.3 (15 Aug 2013 17:17:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 15 Aug 2013 17:17:27 +0000 (UTC) Cc: 15101@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 15 19:17:28 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VA1Am-0001Ns-Vl for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2013 19:17:21 +0200 Original-Received: from localhost ([::1]:54631 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VA1Am-0005z0-HW for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2013 13:17:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VA1Ac-0005nF-HE for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2013 13:17:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VA1AU-000721-Nu for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2013 13:17:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VA1AU-00071s-Kd for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2013 13:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VA1AT-0002zN-Ng for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2013 13:17:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Helmut Eller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Aug 2013 17:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15101 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15101-submit@debbugs.gnu.org id=B15101.137658698411426 (code B ref 15101); Thu, 15 Aug 2013 17:17:01 +0000 Original-Received: (at 15101) by debbugs.gnu.org; 15 Aug 2013 17:16:24 +0000 Original-Received: from localhost ([127.0.0.1]:60853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA19s-0002yD-AU for submit@debbugs.gnu.org; Thu, 15 Aug 2013 13:16:24 -0400 Original-Received: from mail-ea0-f171.google.com ([209.85.215.171]:62007) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA19q-0002xy-IL for 15101@debbugs.gnu.org; Thu, 15 Aug 2013 13:16:23 -0400 Original-Received: by mail-ea0-f171.google.com with SMTP id n15so494928ead.2 for <15101@debbugs.gnu.org>; Thu, 15 Aug 2013 10:16:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=LGtDLzHWeBR5pGtLOoN6EH1xx/OjIOgA4spECnDU8Is=; b=kzzespxRiVuK3NQ6Y+JUhtdTW/LFVZaj9uE2Lm8JoTlpMiMASL7XWJq0DXYTUYV3OO pJVrO7IQf2ySPkyDUJM++0W68KkH+XInbK0dG/4fiTm911i0WD8rm2HbEUpqJ0TL31px iAMD5AqGqPFyy1DpL+zq39fKbGvJp1zoneIjFIy1PNuu8yOeTE9wsaDeO7Re7O5m0GVM z6GEd/j83Ni6xzYqukl8R6jpaF5JQsuC0UROzF94QNPmYqVRAjqKw/XveRGcEkp0ye+1 H/lh3jOV3xE/atHQU3+n5X0I6G54fF1EWKcwcP1mNDOnW1dH6U8qfl2rlF93LYBcG9hO AfPA== X-Received: by 10.15.108.72 with SMTP id cc48mr4319858eeb.69.1376586973784; Thu, 15 Aug 2013 10:16:13 -0700 (PDT) Original-Received: from ix (dial-180057.pool.broadband44.net. [212.46.180.57]) by mx.google.com with ESMTPSA id bp43sm86199600eeb.4.2013.08.15.10.16.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 10:16:13 -0700 (PDT) Original-Received: from helmut by ix with local (Exim 4.80) (envelope-from ) id 1VA19e-0000tf-JK; Thu, 15 Aug 2013 19:16:11 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 15 Aug 2013 10:45:52 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:77393 Archived-At: 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