emacs-devel
[Top][All Lists]
Advanced

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

callback functions in Emacs


From: Michael Albinus
Subject: callback functions in Emacs
Date: Tue, 04 Sep 2007 22:27:43 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

Hi,

I'm playing a little bit with integration of D-Bus(*) into Emacs. In
order to get this, I'm writing dbusbindings.{h,c}, which are linked to
Emacs.

One of the basic concepts od D-Bus is, that one could register a
callback function which is applied when there bis a signal on the bus
one has registered for. That works fine as long everything is handled on
C level. But I intend to register a callback C function, which calls
then a Lisp function internally (via Ffuncall etc).

Unfortunately, this fails. Feval does abort when evalling the
corresponding Lisp form, because handling_signal is equal 1 (the comment
in eval.c explains, that the Lisp interpreter cannot be called from a
signal handler, because it isn't reentrant).

One possible solution I found is the use of an additional, Emacs
internal network process, installed when registering the callback
function in D-Bus. I can send something to the process when being inside
the callback function. The process filter of this process reads then the
sent string, and calls the corresponding Lisp function.

But that looks ugly to me. Isn't there another, more simple way to
evaluate Lisp code from inside a callback function?

(*): http://dbus.freedesktop.org

TIA, and best regards, Michael.




reply via email to

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