]> git.eshelyaron.com Git - emacs.git/commitdiff
* doc/misc/dbus.texi (Type Conversion): Check for subfeature. scratch/dbusbind-type
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 30 Aug 2015 13:51:36 +0000 (15:51 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 30 Aug 2015 13:51:36 +0000 (15:51 +0200)
* src/dbusbind.c (syms_of_dbusbind):
* lisp/net/dbus.el (top): Provide proper subfeature.

doc/misc/dbus.texi
lisp/net/dbus.el
src/dbusbind.c

index e0b2f2c462de49946fc3f8ba57208f223edd91ff..863b7b05ffe5719267032a01908f5d5d74a9e4e8 100644 (file)
@@ -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
-@code{(:array :int32)} stands for an array of @code{DBUS_TYPE_INT32}
-elements.
+type as a list of type symbols.@footnote{This alternative form is
+available only if the subfeature @code{:type} exists.  Check it with
+
+@lisp
+(featurep 'dbus :type)
+@end 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.
index 8f7754137cbb4be105dd1afaa19c888c57ffbf5e..811c63d4aa82982ff4a3fbde2f65d76e140e342d 100644 (file)
@@ -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:
 
index 46b8b04d15dafe6bc8376ea7c4f890f3f5dab78f..badf6b587d69c2c708cf3956ed11c7e5eeb7315b 100644 (file)
@@ -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);
 
 }