unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Rahguzar <rahguzar@zohomail.eu>
Cc: help-gnu-emacs@gnu.org
Subject: Re: dbus-register-method and introspection
Date: Sun, 21 May 2023 17:35:07 +0200	[thread overview]
Message-ID: <87bkidofys.fsf@gmx.de> (raw)
In-Reply-To: <87mt1xuchq.fsf@math.uu.se> (rahguzar@zohomail.eu's message of "Sun, 21 May 2023 13:40:23 +0200")

Rahguzar <rahguzar@zohomail.eu> writes:

> Hello all,

Hi Rahguzar,

> I am playing with the d-bus integration in Emacs 29.0.91. When I
> register a method with `dbus-register-method` I am unable to see what
> effect it has had. For example if I evaluate the following code in the
> node (dbus) Register Objects of the manual,
>
>
> (defun my-dbus-method-handler (filename) (if (find-file filename)
>   '(:boolean t) '(:boolean nil)))
>
> (dbus-register-method :session "org.freedesktop.TextEditor"
>  "/org/freedesktop/TextEditor" "org.freedesktop.TextEditor" "OpenFile"
>  #'my-dbus-method-handler)
>
> and then evaluate
>
> (dbus-introspect-xml :session "org.freedesktop.TextEditor"
> "/org/freedesktop/TextEditor")
>
> I get nil. Similarly I can see the service 'org.freedesktop.TextEditor'
> in the application 'd-feet' but clicking on it doesn't show the method
> that was registered above and after a while I get a timeout error. This
> is in contrast to other services for which I can see what interfaces and
> methods they provide.
>
> Is there a simple way to expose such information for the services
> provided from inside emacs?

The dbus-introspect-* methods work over the
"org.freedesktop.DBus.Introspectable" interface. You must provide an own
implementation for this with your "org.freedesktop.TextEditor" service,
if you want to see the introspection data.

Most existing D-Bus services provide an own file with that data, see
directory /usr/share/dbus-1/interfaces (on my Fedora system, it could be
somewhere else on your system). When this interface is called, they
simply dump out the respective file.

> Thanks in advance,
> Rahguzar

Best regards, Michael.



  reply	other threads:[~2023-05-21 15:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-21 11:40 dbus-register-method and introspection Rahguzar
2023-05-21 15:35 ` Michael Albinus [this message]
2023-05-21 16:41   ` Rahguzar
2023-05-21 18:13     ` Michael Albinus

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=87bkidofys.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=rahguzar@zohomail.eu \
    /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.
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).