unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Shouldn't edebug-eval-last-sexp work too outside of edebug?
Date: Mon, 28 Feb 2022 00:01:15 +0100	[thread overview]
Message-ID: <8735k3symc.fsf@web.de> (raw)
In-Reply-To: Md8pq74nZYm3OVPez62DsnrNa3JCmYTL4wkfpJRJgm9_3cOLMuwNU9wTJ6_fgggR9iVCqvNDFB9TGcV8Hh1JTurMMWBMpL3pR6tqDviZuIE=@protonmail.com

emacsq via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> From time to time I use edebug-eval-top-level-form to run forms
> through edebug and it's quite useful.
>
> Sometimes when cursor is after the expression, I invoke
> edebug-eval-last-sexp, but that fails to work outside of edebug.
>
> Shouldn't the latter work too like edebug-eval-top-level-form does if
> it's invoked outside of edebug?

The commands are of quite different nature I think.

`edebug-eval-top-level-form' instruments and evals a form _in_ Edebug,
while `edebug-eval-top-level-form' evals a form from inside edebug, in
the _outer_ (i.e. debugged) context - without Edebug stepping.

Or with other words: edebug-eval-top-level-form is for instrumenting and
starting edebug.  `edebug-eval-top-level-form' exists only for the
purpose that C-x C-e behaves as expected - you don't want it to evaluate
stuff in the inside context, the edebug session, where lexical bindings
would not be visible etc.  That would not be very useful (unless for
debugging Edebug maybe).

Try to use them and you'll see how that makes sense.

Michael.




      reply	other threads:[~2022-02-27 23:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-27 16:12 Shouldn't edebug-eval-last-sexp work too outside of edebug? emacsq via Users list for the GNU Emacs text editor
2022-02-27 23:01 ` Michael Heerdegen [this message]

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=8735k3symc.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=help-gnu-emacs@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.
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).