From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 07:40:34 2013 Received: (at submit) by debbugs.gnu.org; 15 Aug 2013 11:40:34 +0000 Received: from localhost ([127.0.0.1]:59945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9vus-0007ZK-21 for submit@debbugs.gnu.org; Thu, 15 Aug 2013 07:40:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41748) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9vup-0007Z6-CO for submit@debbugs.gnu.org; Thu, 15 Aug 2013 07:40:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9vub-0003Xo-6Q for submit@debbugs.gnu.org; Thu, 15 Aug 2013 07:40:26 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,USER_IN_WHITELIST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9vub-0003Xk-3w for submit@debbugs.gnu.org; Thu, 15 Aug 2013 07:40:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9vuS-0000nh-Bz for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2013 07:40:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9vuJ-0003Cv-V1 for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2013 07:40:08 -0400 Received: from mail-ea0-x232.google.com ([2a00:1450:4013:c01::232]:64305) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9vuJ-0003Cm-Oz for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2013 07:39:59 -0400 Received: by mail-ea0-f178.google.com with SMTP id a15so312147eae.9 for ; Thu, 15 Aug 2013 04:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=IVsd6I3JeWnQkcIMJNpMbi9h2PEq6pvfm1MVtc+LFyc=; b=QXD4h5l5RbASsE9hAfQK7UHUnNniC9RxBhCsEUWn2mWb2IW/maAtnH6fnrfl0RA+Mj rLwC8EsZwnov3AHXtjbVDKuhdmE9di7rqa9I5WRF/7yXNGHM5ahn0YyHPCa92zeAmCUP Dcd1h5fILy4wFEO0SUjJKX5XO2E8MnKeDhLlWKOfoqamrwhTdIZ4TCCO0pqnwZZUzmxZ KM0P3nSpfOPU1tFbsRllpa5v1ySiliG/K9gvK47MnA7QjZZG6F9lFH1D+w7hFmnbe4IS a8yyvIqHvUKH+bjv2rWEPRP563abEfXoP/8L46mve9Gllv5FiooJy4L64BXVi0a5W/Pe jUKQ== X-Received: by 10.15.35.196 with SMTP id g44mr22398538eev.18.1376566798564; Thu, 15 Aug 2013 04:39:58 -0700 (PDT) Received: from ix (dial-180057.pool.broadband44.net. [212.46.180.57]) by mx.google.com with ESMTPSA id bn13sm83779507eeb.11.2013.08.15.04.39.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 04:39:57 -0700 (PDT) Received: from helmut by ix with local (Exim 4.80) (envelope-from ) id 1V9vuF-0003Iy-LK for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2013 13:39:55 +0200 From: Helmut Eller To: bug-gnu-emacs@gnu.org Subject: 24.3.50; debugger-eval-expression broken Date: Thu, 15 Aug 2013 13:39:55 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) 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. In GNU Emacs 24.3.50.2 (i686-pc-linux-gnu, GTK+ Version 2.24.10) of 2013-08-15 on ix Bzr revision: 113885 xfq.free@gmail.com-20130815082722-3v7q6fyczifh2s97 From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 10:46:02 2013 Received: (at 15101) by debbugs.gnu.org; 15 Aug 2013 14:46:02 +0000 Received: from localhost ([127.0.0.1]:60503 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9yoL-0004xS-Uv for submit@debbugs.gnu.org; Thu, 15 Aug 2013 10:46:02 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:32740) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9yoJ-0004x5-5Y for 15101@debbugs.gnu.org; Thu, 15 Aug 2013 10:45:59 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFLd/Nq/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw X-IPAS-Result: Av8EABK/CFFLd/Nq/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="21940037" Received: from 75-119-243-106.dsl.teksavvy.com (HELO pastel.home) ([75.119.243.106]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 15 Aug 2013 10:45:46 -0400 Received: by pastel.home (Postfix, from userid 20848) id C708466215; Thu, 15 Aug 2013 10:45:52 -0400 (EDT) From: Stefan Monnier To: Helmut Eller Subject: Re: bug#15101: 24.3.50; debugger-eval-expression broken Message-ID: References: Date: Thu, 15 Aug 2013 10:45:52 -0400 In-Reply-To: (Helmut Eller's message of "Thu, 15 Aug 2013 13:39:55 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15101 Cc: 15101@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > 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. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 11:06:50 2013 Received: (at 15101) by debbugs.gnu.org; 15 Aug 2013 15:06:51 +0000 Received: from localhost ([127.0.0.1]:60548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9z8U-0005bd-FV for submit@debbugs.gnu.org; Thu, 15 Aug 2013 11:06:50 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:27559) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V9z8S-0005bK-CA for 15101@debbugs.gnu.org; Thu, 15 Aug 2013 11:06:48 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r7FF6dVn010988 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Aug 2013 15:06:40 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7FF6cdG025213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Aug 2013 15:06:39 GMT Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7FF6cxW018876; Thu, 15 Aug 2013 15:06:38 GMT MIME-Version: 1.0 Message-ID: Date: Thu, 15 Aug 2013 08:06:37 -0700 (PDT) From: Drew Adams To: Stefan Monnier , Helmut Eller Subject: RE: bug#15101: 24.3.50; debugger-eval-expression broken References: In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6668.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: 15101 Cc: 15101@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) > > 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. >=20 > 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. >=20 > This refinement can be useful for dynamically bound variables, but was > mostly added for lexically bound variables, where it's indispensable. >=20 > 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'". >=20 > 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. In your judgment, can both the old `e' behavior and the new `e' behavior be useful, at least for dynamically bound variables? If so, perhaps consider having two different keys, for the two different behaviors. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 12:37:26 2013 Received: (at 15101) by debbugs.gnu.org; 15 Aug 2013 16:37:26 +0000 Received: from localhost ([127.0.0.1]:60731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA0YA-0000t9-BC for submit@debbugs.gnu.org; Thu, 15 Aug 2013 12:37:26 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:42163) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA0Y8-0000su-0f for 15101@debbugs.gnu.org; Thu, 15 Aug 2013 12:37:24 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFLd/Nq/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw X-IPAS-Result: Av8EABK/CFFLd/Nq/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="21950708" Received: from 75-119-243-106.dsl.teksavvy.com (HELO pastel.home) ([75.119.243.106]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 15 Aug 2013 12:37:11 -0400 Received: by pastel.home (Postfix, from userid 20848) id 10D4666215; Thu, 15 Aug 2013 12:37:13 -0400 (EDT) From: Stefan Monnier To: Drew Adams Subject: Re: bug#15101: 24.3.50; debugger-eval-expression broken Message-ID: References: Date: Thu, 15 Aug 2013 12:37:13 -0400 In-Reply-To: (Drew Adams's message of "Thu, 15 Aug 2013 08:06:37 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15101 Cc: Helmut Eller , 15101@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > 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). Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 13:04:13 2013 Received: (at 15101) by debbugs.gnu.org; 15 Aug 2013 17:04:13 +0000 Received: from localhost ([127.0.0.1]:60815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA0y4-0002dR-Nn for submit@debbugs.gnu.org; Thu, 15 Aug 2013 13:04:13 -0400 Received: from userp1050.oracle.com ([156.151.31.82]:35441) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA0y0-0002dB-3d for 15101@debbugs.gnu.org; Thu, 15 Aug 2013 13:04:10 -0400 Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by userp1050.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r7FH408T017041 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for <15101@debbugs.gnu.org>; Thu, 15 Aug 2013 17:04:02 GMT Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r7FH3rZk005920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Aug 2013 17:04:00 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7FH3lre026114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Aug 2013 17:03:48 GMT Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7FH3lIT026101; Thu, 15 Aug 2013 17:03:47 GMT MIME-Version: 1.0 Message-ID: Date: Thu, 15 Aug 2013 10:03:46 -0700 (PDT) From: Drew Adams To: Stefan Monnier Subject: RE: bug#15101: 24.3.50; debugger-eval-expression broken References: In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6668.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: userp1040.oracle.com [156.151.31.81] X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: 15101 Cc: Helmut Eller , 15101@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) > > In your judgment, can both the old `e' behavior and the new `e' > > behavior be useful, at least for dynamically bound variables? >=20 > `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'). From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 13:16:24 2013 Received: (at 15101) by debbugs.gnu.org; 15 Aug 2013 17:16:24 +0000 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 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 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) 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) Received: from helmut by ix with local (Exim 4.80) (envelope-from ) id 1VA19e-0000tf-JK; Thu, 15 Aug 2013 19:16:11 +0200 From: Helmut Eller To: Stefan Monnier Subject: Re: bug#15101: 24.3.50; debugger-eval-expression broken References: Date: Thu, 15 Aug 2013 19:16:10 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 15 Aug 2013 10:45:52 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15101 Cc: 15101@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 13:22:02 2013 Received: (at 15101-done) by debbugs.gnu.org; 15 Aug 2013 17:22:02 +0000 Received: from localhost ([127.0.0.1]:60866 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA1FK-00037s-5Q for submit@debbugs.gnu.org; Thu, 15 Aug 2013 13:22:02 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:15052) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA1FI-00037V-0K for 15101-done@debbugs.gnu.org; Thu, 15 Aug 2013 13:22:00 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFFLd/Nq/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw X-IPAS-Result: Av8EABK/CFFLd/Nq/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="21954514" Received: from 75-119-243-106.dsl.teksavvy.com (HELO pastel.home) ([75.119.243.106]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 15 Aug 2013 13:21:47 -0400 Received: by pastel.home (Postfix, from userid 20848) id DF39466215; Thu, 15 Aug 2013 13:21:53 -0400 (EDT) From: Stefan Monnier To: Helmut Eller Subject: Re: bug#15101: 24.3.50; debugger-eval-expression broken Message-ID: References: Date: Thu, 15 Aug 2013 13:21:53 -0400 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) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15101-done Cc: 15101-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > 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. I've just made that change. Thank you, Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 13:47:45 2013 Received: (at 15101-done) by debbugs.gnu.org; 15 Aug 2013 17:47:45 +0000 Received: from localhost ([127.0.0.1]:60908 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA1eC-0003sa-7l for submit@debbugs.gnu.org; Thu, 15 Aug 2013 13:47:44 -0400 Received: from userp1050.oracle.com ([156.151.31.82]:40152) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA1e9-0003sM-KI for 15101-done@debbugs.gnu.org; Thu, 15 Aug 2013 13:47:42 -0400 Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by userp1050.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r7FHlUAQ003817 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for <15101-done@debbugs.gnu.org>; Thu, 15 Aug 2013 17:47:30 GMT Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r7FHlMHl015759 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Aug 2013 17:47:22 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7FHlLJv002858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Aug 2013 17:47:21 GMT Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7FHlKM0010339; Thu, 15 Aug 2013 17:47:20 GMT MIME-Version: 1.0 Message-ID: <8cbe16c2-2347-4312-97ee-5fe9a5b03972@default> Date: Thu, 15 Aug 2013 10:47:20 -0700 (PDT) From: Drew Adams To: Stefan Monnier , Helmut Eller Subject: RE: bug#15101: 24.3.50; debugger-eval-expression broken References: In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6668.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: userp1040.oracle.com [156.151.31.81] X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: 15101-done Cc: 15101-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) > > 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. >=20 > I've just made that change. And you closed the bug. That change does not fix the bug, IMHO. A user will still be tripped up by the undocumented and unguessable behavior. See my previous comments. Please take care of this properly. It is enough that a user does something in another window and then clicks `mouse-1' in the debugger window on a line other than the first, to be completely thrown off. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 16:27:27 2013 Received: (at 15101-done) by debbugs.gnu.org; 15 Aug 2013 20:27:27 +0000 Received: from localhost ([127.0.0.1]:32923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA48k-00089V-CN for submit@debbugs.gnu.org; Thu, 15 Aug 2013 16:27:26 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:57771 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA48h-00089M-AM for 15101-done@debbugs.gnu.org; Thu, 15 Aug 2013 16:27:23 -0400 Received: from [98.143.210.201] (port=50666 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1VA48g-000270-Lc; Thu, 15 Aug 2013 16:27:22 -0400 Received: by ceviche.home (Postfix, from userid 20848) id D776F660F8; Thu, 15 Aug 2013 16:27:23 -0400 (EDT) From: Stefan Monnier To: Drew Adams Subject: Re: bug#15101: 24.3.50; debugger-eval-expression broken Message-ID: References: <8cbe16c2-2347-4312-97ee-5fe9a5b03972@default> Date: Thu, 15 Aug 2013 16:27:23 -0400 In-Reply-To: <8cbe16c2-2347-4312-97ee-5fe9a5b03972@default> (Drew Adams's message of "Thu, 15 Aug 2013 10:47:20 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: 15101-done Cc: Helmut Eller , 15101-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) > A user will still be tripped up by the undocumented and unguessable > behavior. Check the doc before saying it's not documented. And yes, NEWS is part of the doc. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 16:30:19 2013 Received: (at 15101) by debbugs.gnu.org; 15 Aug 2013 20:30:19 +0000 Received: from localhost ([127.0.0.1]:32927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA4BU-0008F8-Qu for submit@debbugs.gnu.org; Thu, 15 Aug 2013 16:30:17 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:57839 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA4BQ-0008Ew-Pn for 15101@debbugs.gnu.org; Thu, 15 Aug 2013 16:30:13 -0400 Received: from [98.143.210.201] (port=50667 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1VA4BQ-0003MT-3R; Thu, 15 Aug 2013 16:30:12 -0400 Received: by ceviche.home (Postfix, from userid 20848) id ABA3C660F8; Thu, 15 Aug 2013 16:30:13 -0400 (EDT) From: Stefan Monnier To: Helmut Eller Subject: Re: bug#15101: 24.3.50; debugger-eval-expression broken Message-ID: References: Date: Thu, 15 Aug 2013 16:30:13 -0400 In-Reply-To: (Helmut Eller's message of "Thu, 15 Aug 2013 19:16:10 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: 15101 Cc: 15101@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) > What does "context" mean? That which is *around*. > 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. The context in which (let ((foo 123)) (debug)) does not include (yet) "foo" (well, maybe it does, but that would be another "foo" than the one inside the let). > It seems to me that a better fix would be to adjust linenumber->context > mapping by one. I don't think this can be done, because the semantics become very weird and unpredictable. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 15 17:13:13 2013 Received: (at 15101-done) by debbugs.gnu.org; 15 Aug 2013 21:13:13 +0000 Received: from localhost ([127.0.0.1]:32956 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA4r2-0000xr-Bu for submit@debbugs.gnu.org; Thu, 15 Aug 2013 17:13:12 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:31909) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VA4qz-0000xa-K3 for 15101-done@debbugs.gnu.org; Thu, 15 Aug 2013 17:13:10 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r7FLD0XM014192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 15 Aug 2013 21:13:01 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7FLCxKd008253 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Aug 2013 21:13:00 GMT Received: from abhmt120.oracle.com (abhmt120.oracle.com [141.146.116.72]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r7FLCxPD006682; Thu, 15 Aug 2013 21:12:59 GMT MIME-Version: 1.0 Message-ID: <79c3e36d-210c-4a44-8033-5baeda94e4a0@default> Date: Thu, 15 Aug 2013 14:12:59 -0700 (PDT) From: Drew Adams To: Stefan Monnier Subject: RE: bug#15101: 24.3.50; debugger-eval-expression broken References: <8cbe16c2-2347-4312-97ee-5fe9a5b03972@default> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6668.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: 15101-done Cc: Helmut Eller , 15101-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) > > A user will still be tripped up by the undocumented and unguessable > > behavior. >=20 > Check the doc before saying it's not documented. > And yes, NEWS is part of the doc. I mentioned clearly that I *did* check the doc: >> 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'). But yes, I had checked only in the most recent build I have (2013-08-08). Mea culpa. If you updated the doc as a result of this bug report (today), and your update addresses all of the concerns I mentioned, great. Pat on back. But if you simply added a blurb to NEWS about this then no, that does not handle the problem adequately for users. If that's all you did then please help users more than that. Yes, NEWS is a part of the doc. That doesn't make it the only place to cover something like this. (A change log is also doc. As is a code comment.) NEWS is doc that users consult to find out about significant changes, but it is not the doc they consult to find out about the product features and how to use them. You don't look only, or even mainly, in NEWS to find out what `C-x C-f' does and how to use it. Likewise, `e' in the debugger. You expect the manuals and `C-h k C-x C-f' to tell you that. And you expect that information to be up-to-date and relatively complete. Users should not need to consult NEWS to find out why something like `e', which they have been using for decades, suddenly does not do what they expect. Each of the debugger commands/keys, of which `e' is one, is described in the Elisp manual. User-visible changes to the behavior should result in an update of that doc. FWIW, I have now checked the latest `debugging.texi' in BZR (http://bzr.savannah.gnu.org/lh/emacs/trunk/annotate/head:/doc/lispref/debu= gging.texi). Unfortunately, I see no change there from what has been there for the description of `e' for a long time. Nothing about any of the things discussed in this thread. No help for a user about cursor on first line; which evaluation context is used when not on first line; differences between lexical and dynamic; etc. Nada. Not a good thing for users. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 16 01:27:35 2013 Received: (at 15101) by debbugs.gnu.org; 16 Aug 2013 05:27:35 +0000 Received: from localhost ([127.0.0.1]:33544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VACZS-0006c0-Ur for submit@debbugs.gnu.org; Fri, 16 Aug 2013 01:27:35 -0400 Received: from mail-ea0-f174.google.com ([209.85.215.174]:64673) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VACZQ-0006bk-Nj for 15101@debbugs.gnu.org; Fri, 16 Aug 2013 01:27:33 -0400 Received: by mail-ea0-f174.google.com with SMTP id z15so771307ead.33 for <15101@debbugs.gnu.org>; Thu, 15 Aug 2013 22:27:26 -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=cXzzWIt2F/yZ54NYGgsoRiFXJ1ahQ2LA92h+yG5vqM0=; b=WbnVTqwl3Ap192zqUer/49g2Yoon0E4DLJVS94/bmdjzEh2yPYyU2OExJF5k7Bmo6s Qw8+Ky934llsdbURXgp0xnDnCx5pgguDj/yLVlaZcJ3SkLXt28NY1wy43q6ir1WZoieb vtXQxEQfcDlIBIyeN8162UoEaZVysN5IO7xD65GEnt/SQqJmpDld2EFypkWqBPNoPLdY E8VXGU0B9U8lBZjEI3RdE2VTuzyZB6N3aIH4L/uF/I9YEj0Q+VqnF+X3z/eZ/+ZaIjhV XSFL+rmzOdn2Sakqq2m0J0BUAPu/RdpaXLIdIp+5fkWZQ9/Jr4gCp8iqzL94qE5D7CC8 hnkw== X-Received: by 10.14.214.136 with SMTP id c8mr27391226eep.6.1376630846947; Thu, 15 Aug 2013 22:27:26 -0700 (PDT) Received: from ix (dial-180057.pool.broadband44.net. [212.46.180.57]) by mx.google.com with ESMTPSA id m54sm4497953eex.2.2013.08.15.22.27.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 15 Aug 2013 22:27:26 -0700 (PDT) Received: from helmut by ix with local (Exim 4.80) (envelope-from ) id 1VACZH-0000sV-R1; Fri, 16 Aug 2013 07:27:23 +0200 From: Helmut Eller To: Stefan Monnier Subject: Re: bug#15101: 24.3.50; debugger-eval-expression broken References: Date: Fri, 16 Aug 2013 07:27:23 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 15 Aug 2013 16:30:13 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15101 Cc: 15101@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Thu, Aug 15 2013, Stefan Monnier wrote: >> What does "context" mean? > > That which is *around*. > >> 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. > > The context in which (let ((foo 123)) (debug)) does not include (yet) > "foo" (well, maybe it does, but that would be another "foo" than the > one inside the let). Consider this example: (progn (defun foo (n) (cond ((= n 0) (debug)) (t (foo (1- n))))) (byte-compile 'foo) (foo 100)) If we go to the line "foo(10)" I would expect that n is 10. With your definition n is 11. I would argue that your version is confusing. >> It seems to me that a better fix would be to adjust linenumber->context >> mapping by one. > > I don't think this can be done, because the semantics become very weird > and unpredictable. Can you give an example of what would be weird with this change: === modified file 'lisp/emacs-lisp/debug.el' --- lisp/emacs-lisp/debug.el 2013-08-15 17:21:19 +0000 +++ lisp/emacs-lisp/debug.el 2013-08-16 05:22:02 +0000 @@ -547,7 +547,7 @@ (interactive (list (read--expression "Eval in stack frame: "))) (let ((nframe (or nframe - (condition-case nil (1+ (debugger-frame-number 'skip-base)) + (condition-case nil (debugger-frame-number 'skip-base) (error 0)))) ;; If on first line. (base (if (eq 'debug--implement-debug-on-entry (cadr (backtrace-frame 1 'debug))) Either way, it would be nice to document why the 1+ was there in the first place, because it looks like a bug to me. Helmut From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 16 12:14:29 2013 Received: (at 15101) by debbugs.gnu.org; 16 Aug 2013 16:14:29 +0000 Received: from localhost ([127.0.0.1]:34876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VAMfU-0001OB-5h for submit@debbugs.gnu.org; Fri, 16 Aug 2013 12:14:28 -0400 Received: from pruche.dit.umontreal.ca ([132.204.246.22]:60313) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VAMfQ-0001Nu-Hu for 15101@debbugs.gnu.org; Fri, 16 Aug 2013 12:14:25 -0400 Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r7GGENrK013333; Fri, 16 Aug 2013 12:14:23 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id A4FEEB44A4; Fri, 16 Aug 2013 12:14:23 -0400 (EDT) From: Stefan Monnier To: Helmut Eller Subject: Re: bug#15101: 24.3.50; debugger-eval-expression broken Message-ID: References: Date: Fri, 16 Aug 2013 12:14:23 -0400 In-Reply-To: (Helmut Eller's message of "Fri, 16 Aug 2013 07:27:23 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4672=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4672> : streams <1020690> : uri <1508486> X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: 15101 Cc: 15101@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) > If we go to the line "foo(10)" I would expect that n is 10. With your > definition n is 11. I would argue that your version is confusing. I think the problem comes from the fact that contrary to traditional debuggers, we don't have the "line-number info". In a traditional debugger, you'd have "foo(10) at foo.el:25", pointing out exactly where you are inside `foo'. Whereas in Elisp backtraces you only have "the expression that was being evaluated", so "foo(10)" doesn't tell you where you were inside `foo', instead it tells you that you were somewhere where a call to `(foo 10) was made. > Can you give an example of what would be weird with this change: [...] > - (condition-case nil (1+ (debugger-frame-number 'skip-base)) > + (condition-case nil (debugger-frame-number 'skip-base) I started with this, but found it very weird for example with things like (let ((x (toto)) (y (titi))) (tata)) where you'd naturally expect to be able to find the value of `x' or `y', but that's only true if the debugger was called from `tata'. If instead the debugger was called from within `toto' or `titi', `x' and `y' aren't bound yet. Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 16 13:03:49 2013 Received: (at 15101) by debbugs.gnu.org; 16 Aug 2013 17:03:49 +0000 Received: from localhost ([127.0.0.1]:34990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VANRD-0003IA-Uq for submit@debbugs.gnu.org; Fri, 16 Aug 2013 13:03:48 -0400 Received: from mail-ea0-f177.google.com ([209.85.215.177]:63446) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VANRA-0003Hk-CD for 15101@debbugs.gnu.org; Fri, 16 Aug 2013 13:03:45 -0400 Received: by mail-ea0-f177.google.com with SMTP id f15so1098464eak.8 for <15101@debbugs.gnu.org>; Fri, 16 Aug 2013 10:03:38 -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=RvabjG92+8ORtHbJeNqwSiEqZD6nSJnolKXXpHTQxrQ=; b=HLfHo0RpzMGw3b6ztRVPuP/ywC9ZqZlKe45Zpbcj9/sWZv5tSOd2I6LbBjSmpNGi6v VkEBCyzFln30bQ2uWeSsz3HUcaUG/m0a6H2bDQhug3olYfkFgQgVH2SjizWDS1b9jZTi jaO0BPJY3YjbrNEcy1kLGkFDxfhKfYI1fb7qjX0xAurJwPpJVA+ytCWRDZAlAc5r9/Zl Q/kUqVhgScyxe8lddLRB7+vLX5fn0I+gYM1rT/mK97hr0N5Kvuw6vp5QRdVQbaIAE4bc 6EAIX7wlmEnkxWACUPsDc/hSJ0Nh8egJJLXRA8LDsd7OrGFDmePf+CYkPLRwZBjXS0Js 7D2A== X-Received: by 10.15.108.72 with SMTP id cc48mr17509eeb.69.1376672618400; Fri, 16 Aug 2013 10:03:38 -0700 (PDT) Received: from ix (dial-180057.pool.broadband44.net. [212.46.180.57]) by mx.google.com with ESMTPSA id bp43sm2095519eeb.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 16 Aug 2013 10:03:37 -0700 (PDT) Received: from helmut by ix with local (Exim 4.80) (envelope-from ) id 1VANR1-0001Pl-V7; Fri, 16 Aug 2013 19:03:36 +0200 From: Helmut Eller To: Stefan Monnier Subject: Re: bug#15101: 24.3.50; debugger-eval-expression broken References: Date: Fri, 16 Aug 2013 19:03:35 +0200 In-Reply-To: (Stefan Monnier's message of "Fri, 16 Aug 2013 12:14:23 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 15101 Cc: 15101@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Fri, Aug 16 2013, Stefan Monnier wrote: >> If we go to the line "foo(10)" I would expect that n is 10. With your >> definition n is 11. I would argue that your version is confusing. > > I think the problem comes from the fact that contrary to traditional > debuggers, we don't have the "line-number info". > > In a traditional debugger, you'd have "foo(10) at foo.el:25", pointing > out exactly where you are inside `foo'. Whereas in Elisp backtraces you > only have "the expression that was being evaluated", so "foo(10)" > doesn't tell you where you were inside `foo', instead it tells you that > you were somewhere where a call to `(foo 10) was made. In this example, there are two positions of interest: 1. for the newest stack frame, the one that looks like foo(0), the "instruction pointer" would be at the callsite for debug. 2. for all other stack frames of the form foo(X) the instruction pointer would be at the same location: the (recursive) callsite for foo. Are there any other places that foo(X) could possibly denote? I think not. So, what value has n at position 1? > >> Can you give an example of what would be weird with this change: > [...] >> - (condition-case nil (1+ (debugger-frame-number 'skip-base)) >> + (condition-case nil (debugger-frame-number 'skip-base) > > I started with this, but found it very weird for example with things like > > (let ((x (toto)) (y (titi))) (tata)) > > where you'd naturally expect to be able to find the value of `x' or `y', > but that's only true if the debugger was called from `tata'. If instead > the debugger was called from within `toto' or `titi', `x' and `y' aren't > bound yet. The 1+ doesn't solve/change that problem, does it? Helmut From unknown Sat Jun 21 10:44:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 14 Sep 2013 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator