emacs-devel
[Top][All Lists]
Advanced

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

Re: Making debugging possible on expressions executed from ielm


From: Jarosław Rzeszótko
Subject: Re: Making debugging possible on expressions executed from ielm
Date: Tue, 16 Jan 2018 07:42:57 +0100

On Mon, Jan 15, 2018 at 10:59 PM, Stefan Monnier <address@hidden> wrote:
> I did not know about condition-case-unless-debug, it indeed does make
> debugging possible with a simpler change and without any side effects.
> I attach the patch.

Have you verified that IELM stays usable after such an error?

In the tests I was able to invent, yes. If you press c from the debugger to continue execution the IELM error message and a new prompt appear as usually, and evaluating new expressions in IELM still works fine. I was mostly interested in seeing the stack trace in the debugger, and I am not a power user of the Emacs debugger, but I did also try evaluating some expressions from the debugger, stepping through etc., it all seemed to work fine. You do see all the ielm internal functions in the stack trace, with the stack trace of your _expression_ on top. This is no different from e.g. evaluating an _expression_ with M-: though, where you also enter the debugger in the context of some Emacs internals. 

I tried to find some trace in the version control history of why the limitation of not respecting debug-on-error could possibly be there, I did not find anything though. The comment about not respecting debug-on-error and debug-on-quit is in ielm.el from 1994:

https://github.com/emacs-mirror/emacs/commit/813f532d2f0d18dcda7d93be2c6cd841815ff8b8#diff-63abff285057c34e375ed9bb9f2f0199R302
 
Are all 3 hunks necessary?

The middle one is the most important as it covers evaluation of the form that was read in. However in the other two cases, of an read error and a pretty printing error, IELM also will show an error before emitting next prompt, and I think you plausibly could be willing to debug the error, or at least examine the stack trace.

I was giving some thought to having ielm-debug-on-error and ielm-debug-on-quit variables, initializing them to debug-on-error and debug-on-quit default values, and having the ielm-* versions take precedence, so that you can customize ielm to behave differently than the rest of Emacs. Personally though I think it only would make sense if there were some pitfalls or quirks in debugging from IELM, and right now I don't see any.

Cheers,
Jarosław Rzeszótko

reply via email to

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