all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: emacs-devel@gnu.org
Subject: callback functions in Emacs
Date: Tue, 04 Sep 2007 22:27:43 +0200	[thread overview]
Message-ID: <87642qmb0g.fsf@gmx.de> (raw)

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	other threads:[~2007-09-04 20:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-04 20:27 Michael Albinus [this message]
2007-09-04 21:21 ` callback functions in Emacs David Kastrup
2007-09-04 22:32 ` Davis Herring
2007-09-05  1:15   ` Stefan Monnier
2007-09-05  6:16 ` Richard Stallman
2007-09-05  8:43   ` Michael Albinus
2007-09-05 10:01     ` Miles Bader
2007-09-05 15:31       ` Michael Albinus
2007-09-05 10:30     ` Thien-Thi Nguyen
2007-09-05 10:48       ` Michael Albinus
2007-09-05 14:30       ` Davis Herring
2007-09-05 15:18         ` Michael Albinus
2007-09-05 16:09           ` Stefan Monnier
2007-09-05 16:40         ` Thien-Thi Nguyen
2007-09-06  6:12           ` dhruva
2007-09-05 15:34 ` Leo
2007-09-06  4:59   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87642qmb0g.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.