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: Fri, 16 Aug 2013 07:27:23 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1376630900 1823 80.91.229.3 (16 Aug 2013 05:28:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Aug 2013 05:28:20 +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 Fri Aug 16 07:28:21 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 1VACaD-0004d7-31 for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Aug 2013 07:28:21 +0200 Original-Received: from localhost ([::1]:56658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VACaC-0006c1-B5 for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Aug 2013 01:28:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VACa2-0006QL-CX for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 01:28:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VACZv-0005OX-1k for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 01:28:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VACZu-0005OT-Ty for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 01:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VACZu-0006cl-8R for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 01:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Helmut Eller Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 16 Aug 2013 05:28:02 +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.137663085525424 (code B ref 15101); Fri, 16 Aug 2013 05:28:02 +0000 Original-Received: (at 15101) by debbugs.gnu.org; 16 Aug 2013 05:27:35 +0000 Original-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 Original-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 Original-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) Original-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) Original-Received: from helmut by ix with local (Exim 4.80) (envelope-from ) id 1VACZH-0000sV-R1; Fri, 16 Aug 2013 07:27:23 +0200 In-Reply-To: (Stefan Monnier's message of "Thu, 15 Aug 2013 16:30:13 -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:77413 Archived-At: 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