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

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

Re: How to debug elisp code written using the "deferred" package


From: John Mastro
Subject: Re: How to debug elisp code written using the "deferred" package
Date: Wed, 22 Feb 2017 10:28:50 -0800

Jeff Rush <address@hidden> wrote:
> I'm new to elisp programming but I've decided to tackle work on the
> org-toodledo package, which uses the deferred.el package. I'm getting
> an error in one of the deferred handlers but can't figure out which
> one. I need to be able to have the error me into the Emacs debugger
> upon an error signal.

I haven't really used deferred but will see if I can offer some general
ideas. What symptom(s) do you see that tell you there's an error in one
of the deferred handlers? For example, if it's a message,
debug-on-message might be of help.

> 1. How can I set the 'deferred:debug' variable to t from within the
> org-toodledo
>     package?  Simply doing the following does not work.
>
>     (setq deferred:debut t)

The setting of deferred:debug is consulted when the deferred:message
macro is expanded. That means you will need to set it with e.g. M-:
(setq deferred:debug t) RET and then re-compile and re-load deferred.el
for it to take effect. Also, note that you've misspelled "debug" as
"debut" above, in case that's present in your code too.

> 2. How can I set the deferred package to drop into the debugger upon an
> error?
>     The following does not seem to work:
>
>    (setq deferred:debug-on-signal t)
>
> I also tried editing the source for deferred.el directly to change
> those values but still cannot get into the debugger. I just get a
> brief error message in the message without about insufficient args for
> a format string with no clue as to where it happens.

It looks like deferred:debug-on-signal is only meaningful to code inside
deferred:condition-case. I'm not sure whether that's relevant, but it
doesn't hurt to also set debug-on-error and debug-on-signal in case the
error is really somewhere else.

> Any advice please? I've tried to find more advance documentation on
> the deferred package, without luck.

Hopefully something above will help, or someone with more knowledge of
deferred will drop by soon.

        John



reply via email to

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