emacs-devel
[Top][All Lists]
Advanced

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

Re: Dynamic modules: emacs-module.c and signaling errors


From: Stefan Monnier
Subject: Re: Dynamic modules: emacs-module.c and signaling errors
Date: Fri, 27 Nov 2015 10:15:49 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>> You mean debug-on-error will properly show me the right stack state and
>> let me look up and change the corresponding variables?
> Up to the C level, yes.  You cannot do that once you get to the C
> level, not with the Lisp debugger we have.

So you're saying that if I call a command which internally calls
a C module function which turn does "env->funcall" on some Elisp code
which then signals an error, I'll be throw into the *Backtrace* buffer
(after setting debug-on-error and not debug-on-signal) right at the
point where the error is really signaled (i.e. before returning to the
module's C code), and not later on when it is rethrown by the module
code?

>> The core provides naturally a plain raw non-catching funcall, but with
>> the current design a module author who wants this behavior can't have it
> Why would a module author want a non-catching funcall?

Why not?  Most funcalls from Emacs's C to Elisp in Emacs do not want to
catch errors and I see no reason why module code should be so
fundamentally different.

> Are the reasons for having that strong enough to override the dangers?

What danger?

> Because there are other things a module author currently cannot do, as
> the API offers only limited ways into Emacs.

Because it's less work than what the current code does.  It's just
giving access to some internal entry point.  Why hide this entry point?

>> The criteria to accept bad design shouldn't be "does the code
>> already exist?".
> And whether it works, yes.

No.  These are necessary criteria but not sufficient.


        Stefan



reply via email to

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