[Top][All Lists]

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

Re: Catch arbitrary signal and throw it later in C

From: Yuan Fu
Subject: Re: Catch arbitrary signal and throw it later in C
Date: Thu, 13 Apr 2023 01:12:37 -0700

> On Apr 13, 2023, at 12:33 AM, Ruijie Yu <ruijie@netyu.xyz> wrote:
> Yuan Fu <casouri@gmail.com> writes:
>> Say I have an arbitrary Lisp function func, and need to evaluate it in C. But
>> after evaluating the function, I need to do some clean up (freeing
>> something). Would be be possible to catch any signal thrown by evaluating the
>> function func, and throw it after cleaning up?
> Isn't `unwind-protect' (or its internal C functionalities) what you
> want, or is it not suitable in Emacs-C land?  This macro is defined in
> C, FTR.

unwind-protect (and its internal C counterpart) pushes the cleanup form onto 
specpdl. Supposingly that form is later eval’ed? I want to run some C code 
which obviously it doesn’t support. I need to understand how this whole 
unwinding thing work before I can maybe modify or write something that does 
what I want. Hopefully some one can enlighten me :-)


reply via email to

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