From: Michael Albinus <michael.albinus@gmx.de>
To: Jan Moringen <jan.moringen@uni-bielefeld.de>
Cc: emacs-devel@gnu.org
Subject: Re: DBus methods without name grabbing
Date: Mon, 03 Jan 2011 13:55:16 +0100 [thread overview]
Message-ID: <87lj32kuyz.fsf@gmx.de> (raw)
In-Reply-To: <19384_1294002375_ZZh0g13mCbLkV.00_1294002364.12635.44.camel@gunhead> (Jan Moringen's message of "Sun, 02 Jan 2011 22:06:04 +0100")
Jan Moringen <jan.moringen@uni-bielefeld.de> writes:
> Hi,
Hi Jan,
> recently I ran into the following DBus-related problem: In order to
> write a telepathy client [1], it is required to provide a certain
> DBus-Interface under a special well-known name. Some telepathy component
> seems to start calling methods immediately after the well-known name is
> taken. Since the interface consists of multiple methods/properties, it
> cannot be ensured that the interface is completely available when the
> name is taken and the first calls are made using Emacs' current
> DBus-interface. This is due to the fact that the function
> `dbus-register-method' immediately takes the name.
In general, I agree with your proposal. I have some few comments:
- The optional parameter in `dbus-register-method' and
`dbus-register-property' shall be called `dont-register-service'. This
would fit the dbus terminology we use so far.
- We might introduce a new function `dbus-register-service' (in dbusbind.c).
It could offer optional argument flags, a list of the supported flags
of "org.freedesktop.DBus.RequestName"
(DBUS_NAME_FLAG_ALLOW_REPLACEMENT, DBUS_NAME_FLAG_REPLACE_EXISTING,
DBUS_NAME_FLAG_DO_NOT_QUEUE). This function shall be called in
`dbus-register-method' and `dbus-register-property' when
`dont-register-service' is nil. Btw, the function
`dbus-unregister-service' exists already ...
- It would be great, if you could add also changed doc strings, changed
dbus.texi, ChangeLog and etc/NEWS entries.
> To allow Emacs to work with this kind of DBus-interfaces, I suggest the
> changes implemented in the attached patch. I don't known the Emacs C
> code well very well, so it probably needs revision.
>
> === modified file 'src/dbusbind.c'
> --- src/dbusbind.c 2010-10-01 13:56:33 +0000
> +++ src/dbusbind.c 2010-10-03 02:17:34 +0000
> @@ -1983,10 +1983,16 @@
>
> /* Request the known name from the bus. We can ignore the result,
> it is set to -1 if there is an error - kind of redundancy. */
> - dbus_error_init (&derror);
> - result = dbus_bus_request_name (connection, SDATA (service), 0, &derror);
> - if (dbus_error_is_set (&derror))
> - XD_ERROR (derror);
> + if (!dont_request_name || NILP (dont_request_name))
dont_request_name is a Lisp object, it is nil when not used in the
call. You shall use
if (NILP (dont_request_name))
Best regards, Michael.
next prev parent reply other threads:[~2011-01-03 12:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-02 21:06 DBus methods without name grabbing Jan Moringen
2011-01-03 12:55 ` Michael Albinus [this message]
2011-01-04 2:42 ` Jan Moringen
2011-01-04 10:10 ` Michael Albinus
2011-01-04 10:29 ` Jan Moringen
2011-01-04 13:09 ` Michael Albinus
2011-01-05 4:17 ` Jan Moringen
2011-01-05 11:45 ` Michael Albinus
2011-01-08 5:48 ` Jan Moringen
2011-01-09 9:42 ` Michael Albinus
2011-01-09 16:08 ` Jan Moringen
2011-01-10 11:40 ` Michael Albinus
[not found] ` <1294201048.2508.1.camel@gunhead>
2011-01-05 10:46 ` Jan Moringen
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lj32kuyz.fsf@gmx.de \
--to=michael.albinus@gmx.de \
--cc=emacs-devel@gnu.org \
--cc=jan.moringen@uni-bielefeld.de \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).