emacs-devel
[Top][All Lists]
Advanced

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

Re: Callbacks from modules


From: Eli Zaretskii
Subject: Re: Callbacks from modules
Date: Fri, 27 Nov 2015 10:29:09 +0200

> From: Ivan Andrus <address@hidden>
> Date: Thu, 26 Nov 2015 20:23:48 -0700
> Cc: address@hidden
> 
> > Then one way would be to have that callback set a flag,
> > provide a Lisp-callable function that returns the flag, and then start
> > a timer that will test the flag and call your Lisp callback when the
> > flag is set.
> 
> I was hoping to avoid polling, since the use case I have would like to start 
> reading again as soon as the previous version finishes.

You could do that on the C level, no?  You don't need anything from
Lisp to start reading again.

> > Another, perhaps simpler, possibility would be to have the module
> > provide a Lisp-callable function that will register a Lisp callback.
> > Then your C callback will simply call that Lisp function.
> 
> I don’t understand how I would implement this option, though it sounds like 
> what I was hoping for.  In order to call a lisp function, don’t I need an 
> emacs_env?

Forget it, it probably won't work anyway, because your C callback runs
in another thread, right?  Module code cannot run in any thread but
the main thread.




reply via email to

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