all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: herring@lanl.gov
Cc: emacs-devel@gnu.org, Thien-Thi Nguyen <ttn@gnuvola.org>, rms@gnu.org
Subject: Re: callback functions in Emacs
Date: Wed, 05 Sep 2007 17:18:06 +0200	[thread overview]
Message-ID: <nqodgh87kh.fsf@alcatel-lucent.de> (raw)
In-Reply-To: <60290.128.165.123.18.1189002611.squirrel@webmail.lanl.gov> (Davis Herring's message of "Wed, 5 Sep 2007 07:30:11 -0700 (PDT)")

"Davis Herring" <herring@lanl.gov> writes:

> Perhaps I misunderstand D-Bus (having only glanced at its front page), but
> I believe that messages can only be delivered to processes (that already
> exist).  We'd have to have some sort of emacsclientserver (perhaps within
> Emacs) that listened for them and translated them into emacsclient
> invocations.  Of course, if such a server is in Emacs, it prevents having
> another program to customize, but then it might as well do what the OP
> suggests and handle the messages itself.

Emacs client can play its role, but for D-Bus it isn't necessary I
believe. When Emacs is started, it registers during the initialization
phase at the D-Bus for a given service. Then an application can send a
message directly to this service, and Emacs is in.

A concept of D-Bus (I haven't mentioned yet) is that it even can start
an application for a service if it doesn't find a registered
one. Example (I assume you run Linux):

Save the following lines as file /usr/share/dbus-1/services/emacs.service

[D-BUS Service]
Name=org.gnu.emacs.TextEditor
Exec=/usr/local/bin/emacs

Send from a shell the command

# dbus-send --session --print-reply --dest=org.gnu.emacs.TextEditor /org/gnu/emacs/TextEditor org.gnu.emacs.TextEditor

The command is just an emulation of a message any application can send
to the session bus.

Then a fresh Emacs will be started. D-Bus waits for a given time that
this Emacs registers the service org.gnu.emacs.TextEditor, and would
provide the message then. You will see that it doesn't work in this
case, there is a timeout because Emacs doesn't register in time (yet).

No need for Emacs client when using D-Bus.

> Davis

Best regards, Michael.

PS: the implementation of callback functions via special-event-map is
already running, but it needs some more tuning. Thanks again for the
hint.

  reply	other threads:[~2007-09-05 15:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-04 20:27 callback functions in Emacs Michael Albinus
2007-09-04 21:21 ` 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 [this message]
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=nqodgh87kh.fsf@alcatel-lucent.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    --cc=herring@lanl.gov \
    --cc=rms@gnu.org \
    --cc=ttn@gnuvola.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.