help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shouldn't edebug-eval-last-sexp work too outside of edebug?


From: Michael Heerdegen
Subject: Re: Shouldn't edebug-eval-last-sexp work too outside of edebug?
Date: Mon, 28 Feb 2022 00:01:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]