From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Allen Li Newsgroups: gmane.emacs.bugs Subject: bug#33201: 26.1; Edebug doesn't work on closures with edebug-unwrap-results Date: Fri, 2 Nov 2018 00:13:31 -0700 Message-ID: References: <20181031150627.67149.qmail@mail.muc.de> <20181101100056.GA4504@ACM> <83sh0khdf6.fsf@gnu.org> <20181101195918.GD4504@ACM> <83bm78h7q7.fsf@gnu.org> <871s84jt3v.fsf@runbox.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1541142795 26285 195.159.176.226 (2 Nov 2018 07:13:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 2 Nov 2018 07:13:15 +0000 (UTC) Cc: acm@muc.de, 33201@debbugs.gnu.org To: gazally@runbox.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 02 08:13:10 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gITdm-0006kA-8Z for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Nov 2018 08:13:10 +0100 Original-Received: from localhost ([::1]:50024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gITfs-0001xn-R1 for geb-bug-gnu-emacs@m.gmane.org; Fri, 02 Nov 2018 03:15:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gITeh-0001GT-4x for bug-gnu-emacs@gnu.org; Fri, 02 Nov 2018 03:14:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gITec-0001GR-1Y for bug-gnu-emacs@gnu.org; Fri, 02 Nov 2018 03:14:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54954) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gITeb-0001GJ-Te for bug-gnu-emacs@gnu.org; Fri, 02 Nov 2018 03:14:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gITeb-00042R-LD for bug-gnu-emacs@gnu.org; Fri, 02 Nov 2018 03:14:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 02 Nov 2018 07:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33201 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33201-submit@debbugs.gnu.org id=B33201.154114283115498 (code B ref 33201); Fri, 02 Nov 2018 07:14:01 +0000 Original-Received: (at 33201) by debbugs.gnu.org; 2 Nov 2018 07:13:51 +0000 Original-Received: from localhost ([127.0.0.1]:59212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gITeQ-00041t-Mk for submit@debbugs.gnu.org; Fri, 02 Nov 2018 03:13:50 -0400 Original-Received: from mail-it1-f182.google.com ([209.85.166.182]:35539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gITeO-00041d-10 for 33201@debbugs.gnu.org; Fri, 02 Nov 2018 03:13:48 -0400 Original-Received: by mail-it1-f182.google.com with SMTP id p64-v6so1984202itp.0 for <33201@debbugs.gnu.org>; Fri, 02 Nov 2018 00:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=t2GV95dif+hJr+odHaURIa5yURwE2bQxJk/t6JXADoY=; b=TljjQB8CsqO8oDA507iVm69bX7h4ccSY0C4TXZfO1+5JePEv6FKcIVkC4vzDOdED9B 3OOVMyRV9EPesDMKsKS9aZnSyceeTJeGs+yHphGDXUj/NlHUZlu2mwjQzgifI4MdGLbe qJNA7cShgKOxU/FOXlIKAtGWB/q2atR55pKzMt5lDIycVySsyQX1OcZ+6de21IOg78Tu 1dL/NBSFXl3s7xa0oSbY2XcUWOJ/aeQpc6INI2ONeDKs8HejN9Q2/0V/JMeiWN2Lf++y viRCDKZ/9mz3wUUup8Iy+I8mRr6PeRcMcXiWbvKphJM9rjDjPU7HhQvusTO3DFt7MEaR hV4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t2GV95dif+hJr+odHaURIa5yURwE2bQxJk/t6JXADoY=; b=W7bpmJUeIDdpR84V1kHPfaWmjTIt84E7EanA1PgWeCVM006ttWXp1rVEyXCudcKG5Y O7RfDv4XNgN57OSDju2piQ7GiEHx1BLX2Nfh170tq+qPhcQj6fTMEBwFvYyDlT6dQVxB 36uuerRtCNBBAlI65wBvA1vPIOr9/vKJvL1PY/V0fIbGj+037Xbu8VXGJMgHO9Dhe9HM 6uxRFELqUoAm8pnmF99hFPLXKg++sd1Fm6dR4ZYPg1tJuFFatJBj7MFYBvQydiW15Y1U QoaBrw7VAvFhWVqDJGgE3T0yHEK92dDkxgTPgIdjpVjly9EzczKjSKBjOEWb45cT3CRH cClw== X-Gm-Message-State: AGRZ1gLyWxsTpX/2Le/RRWGNx7gi2fv/LwaYhAArHgcUtolO3rBIeY4r /gJY1OYq89V+bRX22ZmPVjxXlGqW1Gldi8gc3POSWw== X-Google-Smtp-Source: AJdET5dBCAA/ljzx5s783yK0T5yuZWRNxbafvqoQ6GHd+b7JWeQ55DtS2c5rY+Ok/jHhZsg8CSdWkNtTzdvW0poT8B4= X-Received: by 2002:a24:6841:: with SMTP id v62-v6mr181347itb.8.1541142822345; Fri, 02 Nov 2018 00:13:42 -0700 (PDT) In-Reply-To: <871s84jt3v.fsf@runbox.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:151940 Archived-At: On Thu, Nov 1, 2018 at 4:07 PM Gemini Lasswell wrote: > > I agree with Eli that this is not a major problem. I suggest > we close it as fixed in 27.1. > > Allen, unless you are doing the kind of debugging described in the > docstring for 'edebug-unwrap-results', meaning debugging a macro where > the results of expressions might include Edebug instrumentation, just > leave it set to nil. I can live with that, especially since the backport sounds non-trivial. > Even if you are doing that kind of debugging, first try it without > setting 'edebug-unwrap-results' non-nil, because if things are going > wrong with the Edebug instrumentation because the debug spec for the > macro is incorrect, which is the most common problem with Edebug and > macros, then having Edebug unwrap the results will make it harder to > figure out what the bug is. > > >> > I can: it's quite complex, and even includes gratuitous refactoring of > >> > 'cond' as 'pcase'. > > When I have to dig several levels deep in a Lisp expression, I prefer to > use pcase instead of expressions like "(nthcdr 2 (nth 1 (nth 3 sexp)))" > but I can see that it is a matter of taste. > > >> OK. How about me doing a simpler, but less lazy fix which would just > >> add handling of `closure' into the existing cond form? > > > > That's one thing; the other is why do we need to change edebug-unwrap1 > > as well? AFAIU, that takes care of a separate issue, right? > > The problem isn't only closures, it's that edebug-unwrap* in emacs-26 > doesn't handle dotted forms. For example, evaluating: > > (edebug-unwrap* '(setq foo '(1 . 1))) > > or trying to step through this with Edebug with edebug-unwrap-results > set non-nil: > > (defmacro my-macro (arg) > (let ((foo '(1 . 1))) > `(setq ,arg ',foo))) > > will result in: (wrong-type-argument listp 1) > > The reason I rewrote edebug-unwrap* was to make it robust enough to > handle anything it might find in backtrace frames, including dotted > forms and circular data structures, so that I could use it to make working > *Backtrace* buffers for Edebug that defaulted to not showing the > instrumentation but let you toggle its visibility. Making > edebug-unwrap-results work in more situations was a side effect.