[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/dbusbind-type 47b7026: * doc/misc/dbus.texi (Type
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] scratch/dbusbind-type 47b7026: * doc/misc/dbus.texi (Type Conversion): Check for subfeature. |
Date: |
Sun, 30 Aug 2015 13:51:53 +0000 |
branch: scratch/dbusbind-type
commit 47b70267213517f95283fd6b71e51ab0fef7454e
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>
* doc/misc/dbus.texi (Type Conversion): Check for subfeature.
* src/dbusbind.c (syms_of_dbusbind):
* lisp/net/dbus.el (top): Provide proper subfeature.
---
doc/misc/dbus.texi | 16 ++++++++++++----
lisp/net/dbus.el | 3 ++-
src/dbusbind.c | 8 ++++----
3 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi
index e0b2f2c..863b7b0 100644
--- a/doc/misc/dbus.texi
+++ b/doc/misc/dbus.texi
@@ -1034,14 +1034,20 @@ D-Bus compound type rules. If those elements have a
type different
from the default type, they need to be prefixed with a type symbol.
@lisp
-(dbus-call-method @dots{} :array '(:int32 @var{NAT-NUMBER} :int32
@var{NAT-NUMBER}))
+(dbus-call-method @dots{} '(:array :int32 @var{NAT-NUMBER} :int32
@var{NAT-NUMBER}))
@end lisp
There is an alternative form to specify a compound D-Bus type. The
keyword @code{:type}, followed by a type specifier, denotes a compound
-type as a list of type symbols. For example, a type specifier
address@hidden(:array :int32)} stands for an array of @code{DBUS_TYPE_INT32}
-elements.
+type as a list of type address@hidden alternative form is
+available only if the subfeature @code{:type} exists. Check it with
+
address@hidden
+(featurep 'dbus :type)
address@hidden lisp
+}
+For example, a type specifier @code{(:array :int32)} stands for an
+array of @code{DBUS_TYPE_INT32} elements.
The above example is equivalent to:
@@ -1049,6 +1055,8 @@ The above example is equivalent to:
(dbus-call-method @dots{} :type '(:array :int32) '(@var{NAT-NUMBER}
@var{NAT-NUMBER}))
@end lisp
+The D-Bus compound type rules are:
+
@itemize
@item An array must contain only elements of the same D-Bus type. It
can be empty.
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index 8f77541..811c63d 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -1813,7 +1813,8 @@ this connection to those buses."
(dbus-ignore-errors
(dbus-init-bus :session)))
-(provide 'dbus)
+;; Propagate subfeatures, like `:type'.
+(provide 'dbus (get 'dbusbind 'subfeatures))
;;; TODO:
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 46b8b04..badf6b5 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -32,7 +32,6 @@ along with GNU Emacs. If not, see
<http://www.gnu.org/licenses/>. */
#define DBUS_NUM_MESSAGE_TYPES 5
#endif
-
/* Some platforms define the symbol "interface", but we want to use it
* as a variable name below. */
@@ -709,6 +708,7 @@ xd_append_arg (int dtype, Lisp_Object object,
DBusMessageIter *iter)
if (XD_BASIC_DBUS_TYPE (dtype))
xd_append_basic_arg (dtype, object, iter);
+
else /* Compound types. */
{
@@ -809,6 +809,7 @@ xd_type_spec_to_signature (char *signature, Lisp_Object
spec)
wrong_type_argument (intern ("D-Bus"), spec);
sprintf (signature, "%c", dtype);
}
+
else /* Compound types. */
{
char *subsig;
@@ -881,6 +882,7 @@ xd_append_arg_with_type_spec (Lisp_Object spec, Lisp_Object
object,
wrong_type_argument (intern ("D-Bus"), spec);
xd_append_basic_arg (dtype, object, iter);
}
+
else /* Compound types. */
{
char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH];
@@ -2005,9 +2007,7 @@ be called when the D-Bus reply message arrives. */);
staticpro (&xd_registered_buses);
/* Add subfeature `:type'. */
- subfeatures = pure_cons (pure_cons (QCdbus_type_type, pure_cons (Qt, Qnil)),
- subfeatures);
-
+ subfeatures = Fcons (QCdbus_type_type, subfeatures);
Fprovide (intern_c_string ("dbusbind"), subfeatures);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] scratch/dbusbind-type 47b7026: * doc/misc/dbus.texi (Type Conversion): Check for subfeature.,
Michael Albinus <=