[Top][All Lists]

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

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

From: Tom Tromey
Subject: Re: Dynamic modules: emacs-module.c and signaling errors
Date: Tue, 24 Nov 2015 15:21:20 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Paul> It's so tedious I can't imagine using it that way. Module authors
Paul> shouldn't have to call env->non_local_exit_check (env) after every
Paul> function call, to see whether the function actually worked. Functions
Paul> should be able to signal an error, just as they can in the Emacs core,
Paul> and the error should propagate through calls in a natural way.

Yeah, it's tedious.

The alternative is also error-prone though.  It's very easy to forget
that some cleanup is needed; and the Emacs facilities here aren't really
all that easy to use either.  gdb uses a similar internal system, and it
is better than what Emacs provides, but still error-prone in practice.

Crashing may be the wrong thing to do.  Perhaps module APIs should just
fail when the environment is already in the error state.


reply via email to

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