;;; dbus.el --- Elisp bindings for D-Bus.
-;; Copyright (C) 2007-2015 Free Software Foundation, Inc.
+;; Copyright (C) 2007-2016 Free Software Foundation, Inc.
;; Author: Michael Albinus <michael.albinus@gmx.de>
;; Keywords: comm, hardware
\(dbus-call-method-asynchronously
:system \"org.freedesktop.Hal\" \"/org/freedesktop/Hal/devices/computer\"
- \"org.freedesktop.Hal.Device\" \"GetPropertyString\" 'message
+ \"org.freedesktop.Hal.Device\" \"GetPropertyString\" \\='message
\"system.kernel.machine\")
- => \(:serial :system 2)
+ => (:serial :system 2)
-| i686"
\(dbus-register-signal
:system \"org.freedesktop.Hal\" \"/org/freedesktop/Hal/Manager\"
- \"org.freedesktop.Hal.Manager\" \"DeviceAdded\" 'my-signal-handler)
+ \"org.freedesktop.Hal.Manager\" \"DeviceAdded\" \\='my-signal-handler)
- => \(\(:signal :system \"org.freedesktop.Hal.Manager\" \"DeviceAdded\")
- \(\"org.freedesktop.Hal\" \"/org/freedesktop/Hal/Manager\" my-signal-handler))
+ => ((:signal :system \"org.freedesktop.Hal.Manager\" \"DeviceAdded\")
+ (\"org.freedesktop.Hal\" \"/org/freedesktop/Hal/Manager\" my-signal-handler))
`dbus-register-signal' returns an object, which can be used in
`dbus-unregister-object' for removing the registration."
"Unregister OBJECT from D-Bus.
OBJECT must be the result of a preceding `dbus-register-method',
`dbus-register-property' or `dbus-register-signal' call. It
-returns `t' if OBJECT has been unregistered, `nil' otherwise.
+returns t if OBJECT has been unregistered, nil otherwise.
When OBJECT identifies the last method or property, which is
registered for the respective service, Emacs releases its
;; Service.
(string-equal service (cadr e))
;; Non-empty object path.
- (cl-caddr e)
+ (nth 2 e)
(throw :found t)))))
dbus-registered-objects-table)
nil))))
(defun dbus-list-activatable-names (&optional bus)
"Return the D-Bus service names which can be activated as list.
If BUS is left nil, `:system' is assumed. The result is a list
-of strings, which is `nil' when there are no activatable service
+of strings, which is nil when there are no activatable service
names at all."
(dbus-ignore-errors
(dbus-call-method
(defun dbus-list-names (bus)
"Return the service names registered at D-Bus BUS.
-The result is a list of strings, which is `nil' when there are no
+The result is a list of strings, which is nil when there are no
registered service names at all. Well known names are strings
like \"org.freedesktop.DBus\". Names starting with \":\" are
unique names for services."
(defun dbus-list-queued-owners (bus service)
"Return the unique names registered at D-Bus BUS and queued for SERVICE.
-The result is a list of strings, or `nil' when there are no
+The result is a list of strings, or nil when there are no
queued name owners service names at all."
(dbus-ignore-errors
(dbus-call-method
(defun dbus-get-name-owner (bus service)
"Return the name owner of SERVICE registered at D-Bus BUS.
-The result is either a string, or `nil' if there is no name owner."
+The result is either a string, or nil if there is no name owner."
(dbus-ignore-errors
(dbus-call-method
bus dbus-service-dbus dbus-path-dbus
it shall be checked whether SERVICE is already running, one shall
apply
- \(member service \(dbus-list-known-names bus))"
+ (member service \(dbus-list-known-names bus))"
;; "Ping" raises a D-Bus error if SERVICE does not exist.
- ;; Otherwise, it returns silently with `nil'.
+ ;; Otherwise, it returns silently with nil.
(condition-case nil
(not
(if (natnump timeout)
(defun dbus-introspect-get-annotation-names
(bus service path interface &optional name)
"Return all annotation names as list of strings.
-If NAME is `nil', the annotations are children of INTERFACE,
+If NAME is nil, the annotations are children of INTERFACE,
otherwise NAME must be a \"method\", \"signal\", or \"property\"
object, where the annotations belong to."
(let ((object
(defun dbus-introspect-get-annotation
(bus service path interface name annotation)
"Return ANNOTATION as XML object.
-If NAME is `nil', ANNOTATION is a child of INTERFACE, otherwise
+If NAME is nil, ANNOTATION is a child of INTERFACE, otherwise
NAME must be the name of a \"method\", \"signal\", or
\"property\" object, where the ANNOTATION belongs to."
(let ((elt (xml-get-children
"Return a list of all argument names as list of strings.
NAME must be a \"method\" or \"signal\" object.
-Argument names are optional, the function can return `nil'
+Argument names are optional, the function can return nil
therefore, even if the method or signal has arguments."
(let ((object
(or (dbus-introspect-get-method bus service path interface name)
(bus service path interface name &optional direction)
"Return signature of a `method' or `signal', represented by NAME, as string.
If NAME is a `method', DIRECTION can be either \"in\" or \"out\".
-If DIRECTION is `nil', \"in\" is assumed.
+If DIRECTION is nil, \"in\" is assumed.
-If NAME is a `signal', and DIRECTION is non-`nil', DIRECTION must
+If NAME is a `signal', and DIRECTION is non-nil, DIRECTION must
be \"out\"."
;; For methods, we use "in" as default direction.
(let ((object (or (dbus-introspect-get-method
(defun dbus-get-property (bus service path interface property)
"Return the value of PROPERTY of INTERFACE.
It will be checked at BUS, SERVICE, PATH. The result can be any
-valid D-Bus value, or `nil' if there is no PROPERTY."
+valid D-Bus value, or nil if there is no PROPERTY."
(dbus-ignore-errors
;; "Get" returns a variant, so we must use the `car'.
(car
(defun dbus-set-property (bus service path interface property value)
"Set value of PROPERTY of INTERFACE to VALUE.
It will be checked at BUS, SERVICE, PATH. When the value has
-been set successful, the result is VALUE. Otherwise, `nil' is
+been set successful, the result is VALUE. Otherwise, nil is
returned."
(dbus-ignore-errors
;; "Set" requires a variant.
"Return all properties of INTERFACE at BUS, SERVICE, PATH.
The result is a list of entries. Every entry is a cons of the
name of the property, and its value. If there are no properties,
-`nil' is returned."
+nil is returned."
(dbus-ignore-errors
;; "GetAll" returns "a{sv}".
(let (result)
\(dbus-get-all-managed-objects :session \"org.gnome.SettingsDaemon\" \"/\")
- => \(\(\"/org/gnome/SettingsDaemon/MediaKeys\"
- \(\"org.gnome.SettingsDaemon.MediaKeys\")
- \(\"org.freedesktop.DBus.Peer\")
- \(\"org.freedesktop.DBus.Introspectable\")
- \(\"org.freedesktop.DBus.Properties\")
- \(\"org.freedesktop.DBus.ObjectManager\"))
- \(\"/org/gnome/SettingsDaemon/Power\"
- \(\"org.gnome.SettingsDaemon.Power.Keyboard\")
- \(\"org.gnome.SettingsDaemon.Power.Screen\")
- \(\"org.gnome.SettingsDaemon.Power\"
- \(\"Icon\" . \". GThemedIcon battery-full-charged-symbolic \")
- \(\"Tooltip\" . \"Laptop battery is charged\"))
- \(\"org.freedesktop.DBus.Peer\")
- \(\"org.freedesktop.DBus.Introspectable\")
- \(\"org.freedesktop.DBus.Properties\")
- \(\"org.freedesktop.DBus.ObjectManager\"))
+ => ((\"/org/gnome/SettingsDaemon/MediaKeys\"
+ (\"org.gnome.SettingsDaemon.MediaKeys\")
+ (\"org.freedesktop.DBus.Peer\")
+ (\"org.freedesktop.DBus.Introspectable\")
+ (\"org.freedesktop.DBus.Properties\")
+ (\"org.freedesktop.DBus.ObjectManager\"))
+ (\"/org/gnome/SettingsDaemon/Power\"
+ (\"org.gnome.SettingsDaemon.Power.Keyboard\")
+ (\"org.gnome.SettingsDaemon.Power.Screen\")
+ (\"org.gnome.SettingsDaemon.Power\"
+ (\"Icon\" . \". GThemedIcon battery-full-charged-symbolic \")
+ (\"Tooltip\" . \"Laptop battery is charged\"))
+ (\"org.freedesktop.DBus.Peer\")
+ (\"org.freedesktop.DBus.Introspectable\")
+ (\"org.freedesktop.DBus.Properties\")
+ (\"org.freedesktop.DBus.ObjectManager\"))
...)
If possible, \"org.freedesktop.DBus.ObjectManager.GetManagedObjects\"