unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gemini Lasswell <gazally@runbox.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Alan Mackenzie <acm@muc.de>,
	33201@debbugs.gnu.org, darkfeline@felesatra.moe
Subject: bug#33201: 26.1; Edebug doesn't work on closures with edebug-unwrap-results
Date: Thu, 01 Nov 2018 16:06:12 -0700	[thread overview]
Message-ID: <871s84jt3v.fsf@runbox.com> (raw)
In-Reply-To: <83bm78h7q7.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 01 Nov 2018 22:18:40 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Alan Mackenzie <acm@muc.de>
>> It seems like in Emacs 26.1 edebug can't be reliably used with
>> edebug-unwrap-results non-nil because there's always a chance it will
>> encounter the symbol `closure', at which point it errors out.
>> [`closure' is wierd, because it has a meaning, yet has none of a
>> function, a value, a property list.]
>
> I understand, but why does this make it a "major" problem?  The only
> major problem in Edebug I could understand is if Edebug could not be
> used at all in some popular situation.  FWIW, I never set
> edebug-unwrap-results non-nil, and I'm a happy "Edebugger".
>
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.

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.





  reply	other threads:[~2018-11-01 23:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30  6:49 bug#33201: 26.1; Edebug doesn't work on closures with edebug-unwrap-results Allen Li
     [not found] ` <mailman.3074.1540882208.1284.bug-gnu-emacs@gnu.org>
2018-10-31 15:06   ` Alan Mackenzie
2018-11-01  3:53     ` Allen Li
2018-11-01 10:00       ` Alan Mackenzie
2018-11-01 18:15         ` Eli Zaretskii
2018-11-01 19:59           ` Alan Mackenzie
2018-11-01 20:18             ` Eli Zaretskii
2018-11-01 23:06               ` Gemini Lasswell [this message]
2018-11-02  7:13                 ` Allen Li

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=871s84jt3v.fsf@runbox.com \
    --to=gazally@runbox.com \
    --cc=33201@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=darkfeline@felesatra.moe \
    --cc=eliz@gnu.org \
    /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).