GNU bug report logs - #20193
25.0.50; declarative type specification for D-Bus args

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Daiki Ueno <ueno@HIDDEN>; dated Wed, 25 Mar 2015 03:32:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 18 Sep 2020 13:23:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 18 09:23:28 2020
Received: from localhost ([127.0.0.1]:41290 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kJGMK-0000fK-LH
	for submit <at> debbugs.gnu.org; Fri, 18 Sep 2020 09:23:28 -0400
Received: from quimby.gnus.org ([95.216.78.240]:53958)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1kJGMI-0000f4-Gm
 for 20193 <at> debbugs.gnu.org; Fri, 18 Sep 2020 09:23:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=mlYhiYzwC1Xo5vs06Ulwseg3blDeKoPvms9eece0EGw=; b=cx+Oeqc4PoG/oO8VjKx1z4Az2U
 sXDjCSMcTK9T7pqbwQsoi8YpxKHQr+Lmd9y3sfOlhfkhuv8xnySt4eCeK4JmlMu0Wa2AvWTN2mvaU
 w68xxClQGYyCa6cyTPoiPdkPAtLnGSYNV3ZGZK7lC5v0f9u07kX9xyQo9ELtW6KKp2SI=;
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo)
 by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1kJGM9-0006CY-Lj; Fri, 18 Sep 2020 15:23:20 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN> <874mp628is.fsf@HIDDEN>
 <m3si75xexx.fsf-ueno@HIDDEN> <m3a8tbyim7.fsf-ueno@HIDDEN>
 <87613wkhkm.fsf@HIDDEN> <m38u8pl1vp.fsf-ueno@HIDDEN>
 <87d1y0apav.fsf@HIDDEN> <m3zj13svej.fsf-ueno@HIDDEN>
 <87oahj95p9.fsf@HIDDEN> <m31tee6hhr.fsf-ueno@HIDDEN>
 <87d1xyej6f.fsf@HIDDEN>
X-Now-Playing: Stina Nordenstam's _This Is Stina Nordenstam_: "Sharon & Hope"
Date: Fri, 18 Sep 2020 15:23:16 +0200
In-Reply-To: <87d1xyej6f.fsf@HIDDEN> (Michael Albinus's message of "Fri, 04
 Sep 2015 09:29:44 +0200")
Message-ID: <87zh5ngqwr.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Michael Albinus <michael.albinus@HIDDEN> writes: > Thinking
 about, it seems to be OK. Ah :type keyword must always be > followed by two
 other arguments, and so it takes nil as the empty array > values, instead
 of a boolean false. Whether we allow to [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20193
Cc: Daiki Ueno <ueno@HIDDEN>, 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Michael Albinus <michael.albinus@HIDDEN> writes:

> Thinking about, it seems to be OK. Ah :type keyword must always be
> followed by two other arguments, and so it takes nil as the empty array
> values, instead of a boolean false. Whether we allow to be sloppy, and
> to add a missing nil as empty value list at the end of the arguments, is
> something to be decided (and documented).

Skimming through this thread, it looks like everybody thought that this
was a good idea?  But the branch hasn't received any updates since 2015,
and has not been merged...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 4 Sep 2015 07:29:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 04 03:29:49 2015
Received: from localhost ([127.0.0.1]:48455 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZXlRV-0003ws-1a
	for submit <at> debbugs.gnu.org; Fri, 04 Sep 2015 03:29:49 -0400
Received: from mout.gmx.net ([212.227.17.20]:54146)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <michael.albinus@HIDDEN>) id 1ZXlRS-0003wf-Oy
 for 20193 <at> debbugs.gnu.org; Fri, 04 Sep 2015 03:29:47 -0400
Received: from detlef.gmx.de ([93.209.83.60]) by mail.gmx.com (mrgmx101) with
 ESMTPSA (Nemesis) id 0MIQlv-1ZWwEA218h-004Bb8;
 Fri, 04 Sep 2015 09:29:45 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Daiki Ueno <ueno@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN> <874mp628is.fsf@HIDDEN>
 <m3si75xexx.fsf-ueno@HIDDEN> <m3a8tbyim7.fsf-ueno@HIDDEN>
 <87613wkhkm.fsf@HIDDEN> <m38u8pl1vp.fsf-ueno@HIDDEN>
 <87d1y0apav.fsf@HIDDEN> <m3zj13svej.fsf-ueno@HIDDEN>
 <87oahj95p9.fsf@HIDDEN> <m31tee6hhr.fsf-ueno@HIDDEN>
Date: Fri, 04 Sep 2015 09:29:44 +0200
Message-ID: <87d1xyej6f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:iRcV/OFRXLY31k5VYFI5c8uhSBAl5ra59VDKEooy9X2+5kKeG4b
 7P6gRfYo/6xvKo61N7CU0G00nUpzBo2kztJMrZU1+0vQtv4Uuchy5j7yuuHCGDQne36Kn1H
 PSY/02YKVCJUiPSgC9x8hPnlyWKX0H8Ob//SdDe5nFvnedmw6SjGkC1SgVaYMKdEUJCzEsD
 jcO/yMabJWS6PzSU+fdXg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:c7WoEJaf6XE=:Wfia72pFZ71rrv0tU/21bh
 SiQJrMGJjnF9mE5lLKWwP/HzINpBbM6H6uDsQ/018F6g6b1kWmXh0XJeaF9N6aycbH0yIgU0X
 iwOwCAgrpD8qt1NLRCcniIDBTBB7vjdG9fvFTL83dQiGyLx/yPpcTR1YwY3a+9wSlrHuC98SN
 A4t5aN6b2InjdYKcuizkGWfVW1ZMnue6sAZbtG1zUvJV4SCiI34SIiDaVsBfaiVYy3HGgDks/
 QQnwlLwlsB9jJd1lVqciFYZaFewqIw7ZwMHW6nupQjjzfgCVogK8nC/fMpRfzk5aCA294HqOd
 TPx28C4fgtC5JRqksm1MxdkwkTzSeJYRkaD5R6FnQ3qtVc66amJtBb/MtylUh1JjQiz5S9imD
 RLSG56klXpdQNB2b8lTmxt6GZXAraXnJ8IoekORUs/K8XvXbgY3P6p6MBHpa58RBmXVOeNctZ
 nZmjqcX1QCVxwp7tFK09fOovRQHndXy+NLAJzzWNZnS7+sHP2IpNnsYSOW9NPwNT7KscNUB0h
 uLkZjpNzEFMgELI87+oGimgkuIL3Fg4lxTpjsYsfYGj8NuuY3gQhwuc/FVYBpOZotMuImgu+u
 MSoA+5yqTvG9XoVgeLUSkpRItNq1pnoDZJsBmyQxANKdv7uiGJTdoLWkb6TzuexdbdlNmxk7v
 3vZyeBg/Zy/qzw2Absr4s+2hymdykvpEHy2yqCQw9nWNo/E4eKc8E3LZjJSjWOyY9icuy6b2h
 lPt9zIpf/kwb7mR/OUFnrbrofuar1AGZJvdW1g==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Daiki Ueno <ueno@HIDDEN> writes:

Hi,

>> Well, dbus-test.el passes now, thanks. But there are still some cases
>> I'm not so happy with:
>>
>> plist-get
>>  (dbus--test-create-message-with-args
>>   '(:array)
>>   '(:array :signature "u")
>>   :type '(:array :uint32)
>>   nil)
>>  :signature)
>>
>> |- "asauau"
>>
>> I would expect "asauaub"
>
> Right, thanks for pointing that.

Thinking about, it seems to be OK. Ah :type keyword must always be
followed by two other arguments, and so it takes nil as the empty array
values, instead of a boolean false. Whether we allow to be sloppy, and
to add a missing nil as empty value list at the end of the arguments, is
something to be decided (and documented).

>> Maybe you could be a little bit more verbose about, and adapt the code?
>> When there is a :type argument, there must *always* be two additional
>> arguments?
>
> That makes sense.

As said above.

> Moreover, I personally prefer not to mix implicit and explicit typing.
> So, I am currently thinking to collect type specifiers for all
> arguments as a list and put it in front of the actual arguments, like
> this:
>
> (dbus-message-internal ...
>   :timeout 100
>   :type '((:array :string) (:array :uint32) (:array :uint32) :boolean)
>   '("a") '(1) '(2) t)
>
> How does that sound?

I see two disadvantages:

- You couldn't use some functions any longer, like
  (dbus-string-to-byte-array "Hello world") mixed with :type prefixed
  arguments. Of course one could add a second function which returns
  just the value list, but is it really helpful? It makes everything
  more complex.

- You would loose the simplification of default types. A list is always
  an array of strings, a string is a string, a natural number is a
  uint32, and so on. You would be forced to write down the type
  explicitely for every argument.

And we could simply use signatures then. Something like

(dbus-message-internal ...
  :timeout 100
  :type "asauaub"
  '("a") '(1) '(2) t)

>> As you see, even I (who has tried to understand the new syntax) am a
>> little bit confused.
>
> Yes, I am realizing how helpful it is to write unit tests, to smoke out
> such pitfalls before landing the feature :-)

Yep. On my todo list is also to study the D-Bus tests at
<http://cgit.freedesktop.org/dbus/dbus-test/>. Maybe we could adapt
something from there.

> Regards,

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 4 Sep 2015 02:33:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 03 22:33:34 2015
Received: from localhost ([127.0.0.1]:48325 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZXgon-0002xC-K5
	for submit <at> debbugs.gnu.org; Thu, 03 Sep 2015 22:33:33 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55913)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ueno@HIDDEN>) id 1ZXgol-0002x3-BO
 for 20193 <at> debbugs.gnu.org; Thu, 03 Sep 2015 22:33:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ueno@HIDDEN>) id 1ZXgoh-0001T7-Ns
 for 20193 <at> debbugs.gnu.org; Thu, 03 Sep 2015 22:33:30 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36332)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ueno@HIDDEN>)
 id 1ZXgoh-0001T3-KT; Thu, 03 Sep 2015 22:33:27 -0400
Received: from du-a.org ([219.94.251.20]:35210 helo=dhcp-217-92.nrt.redhat.com)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <ueno@HIDDEN>)
 id 1ZXgog-0002sz-VO; Thu, 03 Sep 2015 22:33:27 -0400
Message-ID: <m31tee6hhr.fsf-ueno@HIDDEN>
From: Daiki Ueno <ueno@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN> <874mp628is.fsf@HIDDEN>
 <m3si75xexx.fsf-ueno@HIDDEN> <m3a8tbyim7.fsf-ueno@HIDDEN>
 <87613wkhkm.fsf@HIDDEN> <m38u8pl1vp.fsf-ueno@HIDDEN>
 <87d1y0apav.fsf@HIDDEN> <m3zj13svej.fsf-ueno@HIDDEN>
 <87oahj95p9.fsf@HIDDEN>
Date: Fri, 04 Sep 2015 11:33:20 +0900
In-Reply-To: <87oahj95p9.fsf@HIDDEN> (Michael Albinus's message of "Thu, 03
 Sep 2015 12:07:30 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

Michael Albinus <michael.albinus@HIDDEN> writes:

> Daiki Ueno <ueno@HIDDEN> writes:
>
>>> For the second new test I'm not sure whether this is possible (the
>>> documentation doesn't speak about), but it looks natural to me.
>>
>> Yes, this was actually a bug because of missing checks on the number of
>> required arguments after `:type'.  Fixed as:
>> http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=scratch/dbusbind-type-tests&id=def5829c0769b142b3cc0d69a9ad58935a9f237f
>
> Well, dbus-test.el passes now, thanks. But there are still some cases
> I'm not so happy with:
>
> plist-get
>  (dbus--test-create-message-with-args
>   '(:array)
>   '(:array :signature "u")
>   :type '(:array :uint32)
>   nil)
>  :signature)
>
> |- "asauau"
>
> I would expect "asauaub"

Right, thanks for pointing that.

> Maybe you could be a little bit more verbose about, and adapt the code?
> When there is a :type argument, there must *always* be two additional
> arguments?

That makes sense.  Moreover, I personally prefer not to mix
implicit and explicit typing.  So, I am currently thinking to collect
type specifiers for all arguments as a list and put it in front of the
actual arguments, like this:

(dbus-message-internal ...
  :timeout 100
  :type '((:array :string) (:array :uint32) (:array :uint32) :boolean)
  '("a") '(1) '(2) t)

How does that sound?

> As you see, even I (who has tried to understand the new syntax) am a
> little bit confused.

Yes, I am realizing how helpful it is to write unit tests, to smoke out
such pitfalls before landing the feature :-)

Regards,
-- 
Daiki Ueno




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 3 Sep 2015 16:08:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 03 12:08:38 2015
Received: from localhost ([127.0.0.1]:47827 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZXX41-0005YM-HK
	for submit <at> debbugs.gnu.org; Thu, 03 Sep 2015 12:08:37 -0400
Received: from chene.dit.umontreal.ca ([132.204.246.20]:33041)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1ZXX40-0005YD-GK
 for 20193 <at> debbugs.gnu.org; Thu, 03 Sep 2015 12:08:36 -0400
Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242])
 by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t83G8ZHt002367;
 Thu, 3 Sep 2015 12:08:35 -0400
Received: by ceviche.home (Postfix, from userid 20848)
 id 49CC566110; Thu,  3 Sep 2015 12:08:35 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Daiki Ueno <ueno@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
Message-ID: <jwv8u8nmqr4.fsf-monnier+emacsbugs@HIDDEN>
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN> <874mp628is.fsf@HIDDEN>
 <m3si75xexx.fsf-ueno@HIDDEN> <m3a8tbyim7.fsf-ueno@HIDDEN>
 <87613wkhkm.fsf@HIDDEN> <m38u8pl1vp.fsf-ueno@HIDDEN>
Date: Thu, 03 Sep 2015 12:08:35 -0400
In-Reply-To: <m38u8pl1vp.fsf-ueno@HIDDEN> (Daiki Ueno's message of "Wed, 02
 Sep 2015 16:24:42 +0900")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV5418=0
X-NAI-Spam-Version: 2.3.0.9393 : core <5418> : inlines <3752> : streams
 <1499231> : uri <2031714>
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org, Michael Albinus <michael.albinus@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.3 (-)

> Thanks for the prompt review.  I was actually not sure about the
> standard usage of subfeatures, and copied the logic from process.c,

subfeatures should be conceptually a set, represented concretely as a list.

> where they are defined as a plist

That'd be a bug (that happens to be harmless if each value in the plist
is nil or t, since it's like adding nil and t to set of subfeatures).

>   (featurep 'make-network-process '(:server t))

Bad idea.

>   (featurep 'make-network-process :server)

That would be right.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 3 Sep 2015 10:07:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 03 06:07:36 2015
Received: from localhost ([127.0.0.1]:47285 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZXRQe-0003Uv-3U
	for submit <at> debbugs.gnu.org; Thu, 03 Sep 2015 06:07:36 -0400
Received: from mout.gmx.net ([212.227.15.18]:54993)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <michael.albinus@HIDDEN>) id 1ZXRQc-0003Un-Dq
 for 20193 <at> debbugs.gnu.org; Thu, 03 Sep 2015 06:07:34 -0400
Received: from detlef.gmx.de ([87.146.55.149]) by mail.gmx.com (mrgmx001) with
 ESMTPSA (Nemesis) id 0Lmb2Z-1YzCbf0cGB-00aG56;
 Thu, 03 Sep 2015 12:07:32 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Daiki Ueno <ueno@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN> <874mp628is.fsf@HIDDEN>
 <m3si75xexx.fsf-ueno@HIDDEN> <m3a8tbyim7.fsf-ueno@HIDDEN>
 <87613wkhkm.fsf@HIDDEN> <m38u8pl1vp.fsf-ueno@HIDDEN>
 <87d1y0apav.fsf@HIDDEN> <m3zj13svej.fsf-ueno@HIDDEN>
Date: Thu, 03 Sep 2015 12:07:30 +0200
In-Reply-To: <m3zj13svej.fsf-ueno@HIDDEN> (Daiki Ueno's message of "Thu, 03
 Sep 2015 18:29:40 +0900")
Message-ID: <87oahj95p9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:ddoKOCS96/PyxEnXMTI8mNhLzWh+Cmdok/n+IpraWVbHImEnei6
 rWnnnZGrgPSxsmA7rQANUH3AEjFww+TEHxJ/bOT/UVhlfbAYLlrydSixXWLPgNbkNO+GD1p
 rscowTbwltZKcnoDMGK6rdUwUN/XgLvoVE5lFRrcte3h8AwY5uMQ0Wjqe6BkNs0s+y6RAeZ
 K8Tj0I5I7nNWBRqtjnTcQ==
X-UI-Out-Filterresults: notjunk:1;V01:K0:wuYi5PCZ/EU=:MlsT8hP7KyZsZfiXvodDKP
 jnvs50A5ahcRjEuVbOkYju7kXqLsXAQJx9nv8Ahm/pSvZkCKt3jnemuskKzIHkBrxPObV3pwU
 Ezqa6yhbOZKO8plVaT8dIQVRKXq9do0F1YByxRRP0Gh8diYpRcH4BfqfW2OTi7qT27L1ZcTXw
 QlzQ5krmiVbxlAi38ZAx4rD2YImf9dYdYBOWBSi7qKgta5YWAFWGKTrdwdtVvMnF4kly2XVGa
 vd8hOgOVyU9Tbhnv13xBcsQgytUiMIKhXUoyojqcQw3p9aHFsxqxGLsNYupwtU40rTuaLHIuN
 mMClmkRg4trduYRql506DFetoVXEosGZXudtYfDvhQcBfd8kYvkkmCN0WW9+vaJdB17sY//2t
 9QZJnPenGDtMkM2THsQRxx8fB4sAdbt8B4hS1CLHqgo0Pxil0ojXN9w1eNpggGZ+L+THXd06c
 jNSI1QQOfOVm605M9EJ7GFLBKo9ndBrptt2sJHm095lhff0VAZJNF6XxmqLyhiNnZ1WfUMX90
 lXTm4W2XbzqPzAMshTAwYsQllKHiJ41ux7csbEGVBwIt554c0d8NOcfJRI3942A/k1xGSY68Z
 hyfUkEw6kOjIKfduovw6hdonlmprDFzHIqD0+jrvutXh3QlxQwyeMzGkIrDlOxignrMBnH8Dk
 Btv0eyeiLWF5vjI1NaAgXHy4s2fNevGmJzqdefWa6O5ov/OUllOS9lm/EE/bGVD1NoTznaRrZ
 la8aUJGXOJwKgZS47X2eXyS62S+CQbSLMnmbrA==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Daiki Ueno <ueno@HIDDEN> writes:

>> For the second new test I'm not sure whether this is possible (the
>> documentation doesn't speak about), but it looks natural to me.
>
> Yes, this was actually a bug because of missing checks on the number of
> required arguments after `:type'.  Fixed as:
> http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=scratch/dbusbind-type-tests&id=def5829c0769b142b3cc0d69a9ad58935a9f237f

Well, dbus-test.el passes now, thanks. But there are still some cases
I'm not so happy with:

plist-get
 (dbus--test-create-message-with-args
  '(:array)
  '(:array :signature "u")
  :type '(:array :uint32)
  nil)
 :signature)

|- "asauau"

I would expect "asauaub"

(plist-get
 (dbus--test-create-message-with-args
  '(:array)
  :type '(:array :uint32)
  '(:array :signature "u")
  '())
 :signature)

|- Debugger entered--Lisp error: (wrong-type-argument numberp :array)

How to specify an empty array, if it isn't the last argument? Maybe like this:

(plist-get
 (dbus--test-create-message-with-args
  '(:array)
  '(:array :signature "u")
  :type '(:array :uint32) nil
  nil)
 :signature)

|- "asauaub"

(plist-get
 (dbus--test-create-message-with-args
  '(:array)
  :type '(:array :uint32) nil
  '(:array :signature "u")
  nil)
 :signature)

|- "asauaub"

Maybe you could be a little bit more verbose about, and adapt the code?
When there is a :type argument, there must *always* be two additional
arguments? Or shall we allow the sloppy writing of one argument (the
type spec), when it is the last in the call, and it is an empty list?
This must be documented, then.

As you see, even I (who has tried to understand the new syntax) am a
little bit confused.

> Regards,

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 3 Sep 2015 09:29:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 03 05:29:55 2015
Received: from localhost ([127.0.0.1]:47268 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZXQqA-0002ZV-Vn
	for submit <at> debbugs.gnu.org; Thu, 03 Sep 2015 05:29:55 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46268)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ueno@HIDDEN>) id 1ZXQq8-0002ZN-8A
 for 20193 <at> debbugs.gnu.org; Thu, 03 Sep 2015 05:29:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ueno@HIDDEN>) id 1ZXQq4-000446-Im
 for 20193 <at> debbugs.gnu.org; Thu, 03 Sep 2015 05:29:51 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51064)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ueno@HIDDEN>)
 id 1ZXQq4-00043v-GQ; Thu, 03 Sep 2015 05:29:48 -0400
Received: from du-a.org ([219.94.251.20]:33511 helo=dhcp-217-92.nrt.redhat.com)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <ueno@HIDDEN>)
 id 1ZXQq3-00033w-QU; Thu, 03 Sep 2015 05:29:48 -0400
Message-ID: <m3zj13svej.fsf-ueno@HIDDEN>
From: Daiki Ueno <ueno@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN> <874mp628is.fsf@HIDDEN>
 <m3si75xexx.fsf-ueno@HIDDEN> <m3a8tbyim7.fsf-ueno@HIDDEN>
 <87613wkhkm.fsf@HIDDEN> <m38u8pl1vp.fsf-ueno@HIDDEN>
 <87d1y0apav.fsf@HIDDEN>
Date: Thu, 03 Sep 2015 18:29:40 +0900
In-Reply-To: <87d1y0apav.fsf@HIDDEN> (Michael Albinus's message of "Wed, 02
 Sep 2015 16:06:32 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

Michael Albinus <michael.albinus@HIDDEN> writes:

>> I was actually not sure about the standard usage of subfeatures, and
>> copied the logic from process.c, where they are defined as a plist, so
>> they can be tested as:
>>
>>   (featurep 'make-network-process '(:server t))
>
> featurep has the restriction, that you can test only one subfeature per
> call. That's why they have created just one "subfeature", being a list.

Thanks for the explanation.

>> I am working on this, but it is turning to be non-trivial.  So, I have
>> pushed it to a separate branch scratch/dbusbind-type-tests, branched off
>> from scratch/dbusbind-type.
>
> Fortunately, I had some time to look on this today. I've committed some
> changes to dbusbind.c, all of them rather cosmetical.

Nice fixes, thanks!

> And I'm asking myself, whether we shall rename `dbus-message-internal'
> and `dbus-message-internal-to-lisp' to `dbus--message-*', in order to
> emphasize their internal nature.

That sounds like a good idea.

> I have added two tests to `dbus-test04-create-message-parameters', both
> fail. The first one must pass; this feature works in the master
> branch.

This was caused by a double registration of `:signature' symbol.  Fixed as:
http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=scratch/dbusbind-type-tests&id=777848833cc9ff40411b78ad107e755172a881b8

> For the second new test I'm not sure whether this is possible (the
> documentation doesn't speak about), but it looks natural to me.

Yes, this was actually a bug because of missing checks on the number of
required arguments after `:type'.  Fixed as:
http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=scratch/dbusbind-type-tests&id=def5829c0769b142b3cc0d69a9ad58935a9f237f

Regards,
-- 
Daiki Ueno





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 2 Sep 2015 14:06:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 02 10:06:47 2015
Received: from localhost ([127.0.0.1]:46578 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZX8gV-00025U-MC
	for submit <at> debbugs.gnu.org; Wed, 02 Sep 2015 10:06:47 -0400
Received: from mout.gmx.net ([212.227.17.22]:56988)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <michael.albinus@HIDDEN>) id 1ZX8gP-00025I-OQ
 for 20193 <at> debbugs.gnu.org; Wed, 02 Sep 2015 10:06:41 -0400
Received: from detlef.gmx.de ([87.146.33.243]) by mail.gmx.com (mrgmx102) with
 ESMTPSA (Nemesis) id 0MPIvU-1ZbYXC1kUS-004V3P;
 Wed, 02 Sep 2015 16:06:34 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Daiki Ueno <ueno@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN> <874mp628is.fsf@HIDDEN>
 <m3si75xexx.fsf-ueno@HIDDEN> <m3a8tbyim7.fsf-ueno@HIDDEN>
 <87613wkhkm.fsf@HIDDEN> <m38u8pl1vp.fsf-ueno@HIDDEN>
Date: Wed, 02 Sep 2015 16:06:32 +0200
In-Reply-To: <m38u8pl1vp.fsf-ueno@HIDDEN> (Daiki Ueno's message of "Wed, 02
 Sep 2015 16:24:42 +0900")
Message-ID: <87d1y0apav.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:ZxhzUpKcKflkGxjMXGkDpY0i5SE/1uRygG1DHTNnsaUXJ401h91
 EpkCxt24kTPP/C52/pEA3eQrVxygtoeLYVkp3pNgeuP5cpPl+Uf4vEHuBa4vTt84cP9KYYc
 ZtrB9T3x65kYvNnyD5y/6afXsVkdIpJXZ4r9hgfFEWD3dWjPaZHCGAWd4RVinTaR018Owah
 W93TojzZJgIfqJTUxSe2A==
X-UI-Out-Filterresults: notjunk:1;V01:K0:ZjJZn3/pyDs=:xI1tYhYPslXUUDTDnevmvp
 iugrBMGiAj6KBj7F6oENwkWwUswgm4y8KfiYWZ1oz2VuzOncZbNK4XFyxw+uqu1LjmEDsDlqb
 +09TfqmsHULRcdFjVjuDA11xVFrct+uk0wD0iPvDMZWyRAEkAJpSk+WRodYA4u/xRlkSdYqFM
 xZZvpLawNNg1FvPJq2NEogCGiS1CtgVVfx8WzuMTXAJLrJNIFpAp8qY5ZA7GJ4XAEh/LtvaMI
 mQidouBaio6tS9AcPRW/2GScrNiUhEIvPs0hhtvrNcZQlNH2bRj+L/RGRtrdEK7CZFrGQtL6I
 QsgV4PKFCUXXL+y60DfHYErAM2LBUmNfsdz/XzvNNIajW9wsw9nbbz3YcPq6HgXoqqCikxI/A
 0OcazBafzKMUHyHKLgrGCwBVJH9kHD5EoPjeoDHFoe+hmNEdAvP4pXyeQqKoYb+boUrT+ij9n
 Rd8b6bjj5U2HRTJDHEBJmR6V7aCGKar7f9xUOAZev4ka99AGKAzGmDRXCbHIau0+pmStEH9Ug
 61Cz6avsuk40Fbdi5VejabNSw9f3DsZGCCtK2n2TwZ0PUttBd3SDMjv6UpL+MLZMbcdIAx17+
 otKwrLcW7/FQvR4UP1at3Wi7zIyDChWUFCmfx5xwe7XL2d3mcIvrkC5JyCsJ+RkxOxclxWyKl
 FF+6gUX2mLeqKnI9NFAipA1zz6FzSaSRgaCS3VWILr3zN9Oa2EW4gVFWZ1QrYo0RZx7gB5zN6
 jeQw/b94lLgGF6NiR+KlYEHiz+2HlBVBQSlqEw==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Daiki Ueno <ueno@HIDDEN> writes:

Hi,

> I was actually not sure about the standard usage of subfeatures, and
> copied the logic from process.c, where they are defined as a plist, so
> they can be tested as:
>
>   (featurep 'make-network-process '(:server t))
>
> instead of:
>
>   (featurep 'make-network-process :server)

featurep has the restriction, that you can test only one subfeature per
call. That's why they have created just one "subfeature", being a list.

> I am working on this, but it is turning to be non-trivial.  So, I have
> pushed it to a separate branch scratch/dbusbind-type-tests, branched off
> from scratch/dbusbind-type.

Fortunately, I had some time to look on this today. I've committed some
changes to dbusbind.c, all of them rather cosmetical. And I'm asking
myself, whether we shall rename `dbus-message-internal' and
`dbus-message-internal-to-lisp' to `dbus--message-*', in order to
emphasize their internal nature.

I have added two tests to `dbus-test04-create-message-parameters', both
fail. The first one must pass; this feature works in the master
branch. For the second new test I'm not sure whether this is possible
(the documentation doesn't speak about), but it looks natural to me.

Could you, pls, check what's up here?

> Regards,

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 2 Sep 2015 07:24:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 02 03:24:56 2015
Received: from localhost ([127.0.0.1]:45853 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZX2Pg-00080u-KK
	for submit <at> debbugs.gnu.org; Wed, 02 Sep 2015 03:24:56 -0400
Received: from eggs.gnu.org ([208.118.235.92]:49955)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ueno@HIDDEN>) id 1ZX2Pe-00080l-2h
 for 20193 <at> debbugs.gnu.org; Wed, 02 Sep 2015 03:24:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ueno@HIDDEN>) id 1ZX2PZ-00037M-HN
 for 20193 <at> debbugs.gnu.org; Wed, 02 Sep 2015 03:24:54 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58653)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ueno@HIDDEN>)
 id 1ZX2PZ-00037F-Di; Wed, 02 Sep 2015 03:24:49 -0400
Received: from du-a.org ([219.94.251.20]:45492 helo=dhcp-217-92.nrt.redhat.com)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <ueno@HIDDEN>)
 id 1ZX2PY-0006uz-L1; Wed, 02 Sep 2015 03:24:49 -0400
Message-ID: <m38u8pl1vp.fsf-ueno@HIDDEN>
From: Daiki Ueno <ueno@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN> <874mp628is.fsf@HIDDEN>
 <m3si75xexx.fsf-ueno@HIDDEN> <m3a8tbyim7.fsf-ueno@HIDDEN>
 <87613wkhkm.fsf@HIDDEN>
Date: Wed, 02 Sep 2015 16:24:42 +0900
In-Reply-To: <87613wkhkm.fsf@HIDDEN> (Michael Albinus's message of "Sun, 30
 Aug 2015 15:54:17 +0200")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

Michael Albinus <michael.albinus@HIDDEN> writes:

> Daiki Ueno <ueno@HIDDEN> writes:
>
>> Sorry, the patch didn't cleanly apply, as I created it with the diff
>> option -w.  The patch now resides in the scratch/dbusbind-type branch
>> for review.
>
> I've reviewed it, looks OK to me. The only thing not working was the
> provided subfeature; I've fixed it in the code.

Thanks for the prompt review.  I was actually not sure about the
standard usage of subfeatures, and copied the logic from process.c,
where they are defined as a plist, so they can be tested as:

  (featurep 'make-network-process '(:server t))

instead of:

  (featurep 'make-network-process :server)

> The same subfeature shall be provided also for dbus.el; users don't
> care about dbusbind.c.

That is a good idea.

> In dbus.texi I have fixed a small error in your example, and I have
> added a note how to test the subfeature.
>
> I've committed my changes to the branch. If nobody else objects, you
> might merge it into master.

Thanks for all the fixups.

>> By the way, for testing, I tend to think there could be a debugging
>> interface, which converts a Lisp expression to a D-Bus message and
>> vice-versa.
>
> Additionally, it might be helpful if you could add some tests to
> test/automated/dbus-tests.el.

I am working on this, but it is turning to be non-trivial.  So, I have
pushed it to a separate branch scratch/dbusbind-type-tests, branched off
from scratch/dbusbind-type.

Regards,
-- 
Daiki Ueno




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 30 Aug 2015 13:54:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Aug 30 09:54:26 2015
Received: from localhost ([127.0.0.1]:42567 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZW33x-0004H3-M2
	for submit <at> debbugs.gnu.org; Sun, 30 Aug 2015 09:54:25 -0400
Received: from mout.gmx.net ([212.227.17.20]:52618)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <michael.albinus@HIDDEN>) id 1ZW33u-0004Gp-Nx
 for 20193 <at> debbugs.gnu.org; Sun, 30 Aug 2015 09:54:23 -0400
Received: from detlef.gmx.de ([87.146.44.125]) by mail.gmx.com (mrgmx101) with
 ESMTPSA (Nemesis) id 0MYbFe-1Z9cPG1Q4Q-00VQ7n;
 Sun, 30 Aug 2015 15:54:20 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Daiki Ueno <ueno@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN> <874mp628is.fsf@HIDDEN>
 <m3si75xexx.fsf-ueno@HIDDEN> <m3a8tbyim7.fsf-ueno@HIDDEN>
Date: Sun, 30 Aug 2015 15:54:17 +0200
Message-ID: <87613wkhkm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:eygaDocYdbt+CAzYTiDHUhx2FEZwVTkINXIV2K78qEH7D6JS62h
 kLWwTdhMaHG+rKm0u46mV648N4SNyZf7YfSeuy88VNPnJK03nScv38MOLmeWtQ9Kh9Gp6Uv
 OF4GNmh1XNyJewgwafqYNng06p+zZ0ACLvetMWuPMoT4jBY+5uhf+w/AjBWnqGZkF2ACbyE
 wUeVAprTo82u6GplN35ZA==
X-UI-Out-Filterresults: notjunk:1;V01:K0:WMLJt26yRMQ=:me4Bx1QK63oCVbQ2dza8UT
 ka5FD8ToIH1PZf/dv3LBVPCn+5sBlMl8nvJWzNXBer6Zzc7XC2IkD1CG82NCF0o6ZwozF65BY
 mCzKY99UdScVs7VegO/Ox0+bauj4zu25ZU74kHdy2jMvwW6hGzevYgqQ3BNhIE3e8gr0hGzUX
 vI0ujuzl3LvWXPXgSn8atJZYFLzeQZnA5FvD1aDF/LDQpchMVDdi4Ho0HksszpezsPiRazsRf
 cTojWHSWOnEUGUN0geIfqvcZ9v4hNL4+6ku4NiYr7j2SMnKZi+FEUpYyO9SKQgaactqbCj1G9
 x6L9kBiJ7eFKjK2Rqb6zJ0MxoRKpGwUuY9Dpl4z8abrezpfwixct8LvV1LOrwUJJ/qVMp0svu
 tg9LuZDRaQgLkfgFyNTgbXNN4/9NHrRRdNhDwvkA9Gobs5ukHrlsCPtjoVUrqvQecNoMQYC5D
 YT++dGjqEaLuoZsbtfb6MAzKgF0BdvJ3lyo/Ujt6lwxO5bYyf5RqWaD6QtS9zma2ft4iPxf1v
 kUe3ubIqhDhTG7PVPo1vbm5KE9FHqJBxxTB41nTFKGJRZFIYZcz4POudi/6//Pq2+3phcxXXE
 6PpR3+6QKnmlWVvpUNTds5CiMfa7I5001tYwsqTAR1EGgqv/+1j5efG24Qm2mVISUAVWnamm/
 8xZbYDld6966TUhmeVB849NJPGs3kKKfQBB9kOFOUOaW1EznTtjYYXwk1uRO1wXxxYYbr+Qaa
 RKXVbFGfHy3agYkogS0hMsCldrGw8bmvhBtbkw==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Daiki Ueno <ueno@HIDDEN> writes:

> Sorry, the patch didn't cleanly apply, as I created it with the diff
> option -w.  The patch now resides in the scratch/dbusbind-type branch
> for review.

I've reviewed it, looks OK to me. The only thing not working was the
provided subfeature; I've fixed it in the code. The same subfeature
shall be provided also for dbus.el; users don't care about dbusbind.c.

In dbus.texi I have fixed a small error in your example, and I have
added a note how to test the subfeature.

I've committed my changes to the branch. If nobody else objects, you
might merge it into master.

> By the way, for testing, I tend to think there could be a debugging
> interface, which converts a Lisp expression to a D-Bus message and
> vice-versa.

Additionally, it might be helpful if you could add some tests to
test/automated/dbus-tests.el.

> Thanks,

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 28 Aug 2015 08:22:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 28 04:22:45 2015
Received: from localhost ([127.0.0.1]:40773 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZVEvs-0000e9-MA
	for submit <at> debbugs.gnu.org; Fri, 28 Aug 2015 04:22:45 -0400
Received: from mout.gmx.net ([212.227.17.21]:52427)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <michael.albinus@HIDDEN>) id 1ZVEvp-0000dz-W3
 for 20193 <at> debbugs.gnu.org; Fri, 28 Aug 2015 04:22:42 -0400
Received: from detlef.gmx.de ([93.209.74.87]) by mail.gmx.com (mrgmx102) with
 ESMTPSA (Nemesis) id 0MMpYB-1Zdk340ZdX-008cAf;
 Fri, 28 Aug 2015 10:22:41 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Daiki Ueno <ueno@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN> <874mp628is.fsf@HIDDEN>
 <m3si75xexx.fsf-ueno@HIDDEN> <m3a8tbyim7.fsf-ueno@HIDDEN>
Date: Fri, 28 Aug 2015 10:22:39 +0200
In-Reply-To: <m3a8tbyim7.fsf-ueno@HIDDEN> (Daiki Ueno's message of "Fri, 28
 Aug 2015 16:31:12 +0900")
Message-ID: <874mjjlt4g.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:Tb1LYqPdCQJVSrB77UxkicC2hFkfQwvSJEqPA9sAZEY6qexaqv1
 YGlmzOy7qXtHR8RLz4POKTBLYzsZR9DG8sv7Alus+Xb+z/EIdsGiMMap3g/oPjwhGMBvYfF
 Yjeqls6Qa0PO18SywmRX1lkfG0mfv+HywucLlqx6qWuliiI0IwfjLKC3Cu3cXqmYKlx399B
 ZadFT/aLheblSzdxHhFaw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:JlN1HaAZobM=:lD9+pPf15TJxR6AFFadknd
 6IPblW5qFZH0QONkeCB/WqcW/IugXq9/3NUd7a4SMNoUHuY3QyNjg8pazzapzGMlZJw0NC3KR
 KwapNNzx4WGhz1ae6w8IpEtPG/dPSQADhQ6aTLHzub7umneCaCb//8JlSv1f7YVDSlNDKETcg
 v8Ck+GnRUlJ6h9GtUGvGQigbcMxjNdLoSPjD+FqHQ8RpzaCFgD0/6ZF9vua42nX3YJbAN5Z/1
 gX1qKHbnIDSwzaxz/1JrjT1aDVILukleR0Qcf0YDT6N1NRw7568vNygv3Ra6UKQkf7wX1+Wtv
 zF1EunxLSOP7eC6YF34RTqdqD+9c40OmjgzbB3tzZeaGs2ZTBQtWEjQpUZH+RjkgqgTcaPPMp
 dg3obD1Y4dgOU7PTvqnX9ex4Z4JEUZBSPFHmXA/LNrvnNzDyVpDClr4APnbmyfL5bV4kN8qvk
 OVEd05UZk8bhNQKGFZGu54D8fNM6oRZwEqmiwgF9wCHTWBbmqJF6v97Nmjb0zT+Ofkl+ZnrGg
 uZt/8UZvcG+3XEq0p0WAudf8NKdmNghpPjDfrRD7nYffJlfOqwSzPrYvA3khg9L1YkTRpFBoQ
 Nh2vIA9iskGwyu28JY3kF0BO57osMHteJOGcIi3QMopPnfBPhYnRwXSLGV7W4YcPIc5MN7Zm3
 yQ16/PGk6I5V2K9bclYEiSwr/KqFqu4/Yua5nPAK4FWHF7PjqYr3k6e/ES4KS8qnsFxtO0eQ3
 VLHqhkf99iPgtK03GUqzrSbXn4xnUov8/Xp4gg==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Daiki Ueno <ueno@HIDDEN> writes:

> Sorry, the patch didn't cleanly apply, as I created it with the diff
> option -w.  The patch now resides in the scratch/dbusbind-type branch
> for review.

No problem, I didn't start the review yet. I hope I could do it over the
weekend.

> By the way, for testing, I tend to think there could be a debugging
> interface, which converts a Lisp expression to a D-Bus message and
> vice-versa.

Good idea. Maybe it shall live in a file outside dbus.el; it's not
necessary to load this always when using D-Bus in Emacs.

> Thanks,

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 28 Aug 2015 07:31:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 28 03:31:29 2015
Received: from localhost ([127.0.0.1]:40756 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZVE8G-0007v7-3V
	for submit <at> debbugs.gnu.org; Fri, 28 Aug 2015 03:31:28 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51745)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ueno@HIDDEN>) id 1ZVE8A-0007uv-7X
 for 20193 <at> debbugs.gnu.org; Fri, 28 Aug 2015 03:31:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ueno@HIDDEN>) id 1ZVE86-0003xq-O6
 for 20193 <at> debbugs.gnu.org; Fri, 28 Aug 2015 03:31:21 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38204)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ueno@HIDDEN>)
 id 1ZVE86-0003xm-Le; Fri, 28 Aug 2015 03:31:18 -0400
Received: from du-a.org ([219.94.251.20]:53613 helo=dhcp-217-92.nrt.redhat.com)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <ueno@HIDDEN>)
 id 1ZVE86-0002cg-2p; Fri, 28 Aug 2015 03:31:18 -0400
Message-ID: <m3a8tbyim7.fsf-ueno@HIDDEN>
From: Daiki Ueno <ueno@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN> <874mp628is.fsf@HIDDEN>
 <m3si75xexx.fsf-ueno@HIDDEN>
Date: Fri, 28 Aug 2015 16:31:12 +0900
In-Reply-To: <m3si75xexx.fsf-ueno@HIDDEN> (Daiki Ueno's message of "Thu, 27
 Aug 2015 18:23:38 +0900")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

Daiki Ueno <ueno@HIDDEN> writes:

> Sorry for the long delay.  I have tried to implement it (patch
> attached).  It basically adds a couple of new functions:

Sorry, the patch didn't cleanly apply, as I created it with the diff
option -w.  The patch now resides in the scratch/dbusbind-type branch
for review.

By the way, for testing, I tend to think there could be a debugging
interface, which converts a Lisp expression to a D-Bus message and
vice-versa.

Thanks,
-- 
Daiki Ueno




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 27 Aug 2015 09:23:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Aug 27 05:23:54 2015
Received: from localhost ([127.0.0.1]:39679 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ZUtPV-0005IN-Su
	for submit <at> debbugs.gnu.org; Thu, 27 Aug 2015 05:23:54 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34891)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ueno@HIDDEN>) id 1ZUtPT-0005IC-FU
 for 20193 <at> debbugs.gnu.org; Thu, 27 Aug 2015 05:23:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ueno@HIDDEN>) id 1ZUtPN-0002gL-M1
 for 20193 <at> debbugs.gnu.org; Thu, 27 Aug 2015 05:23:51 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51304)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ueno@HIDDEN>)
 id 1ZUtPN-0002gC-Ig; Thu, 27 Aug 2015 05:23:45 -0400
Received: from du-a.org ([219.94.251.20]:50722 helo=dhcp-217-92.nrt.redhat.com)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128)
 (Exim 4.82) (envelope-from <ueno@HIDDEN>)
 id 1ZUtPM-0004gl-FI; Thu, 27 Aug 2015 05:23:45 -0400
Message-ID: <m3si75xexx.fsf-ueno@HIDDEN>
From: Daiki Ueno <ueno@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN> <874mp628is.fsf@HIDDEN>
Date: Thu, 27 Aug 2015 18:23:38 +0900
In-Reply-To: <874mp628is.fsf@HIDDEN> (Michael Albinus's message of "Fri, 27
 Mar 2015 08:40:11 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::e
X-Spam-Score: -6.4 (------)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.4 (------)

--=-=-=
Content-Type: text/plain

Michael Albinus <michael.albinus@HIDDEN> writes:

> Daiki Ueno <ueno@HIDDEN> writes:
>
>> Certainly.  Do you have any preference on the alternative form?  My
>> example used the `:type' keyword, but it was a tentative plan and might
>> be too verbose for programmers.  Reusing `:signature' might be a better
>> idea as you mentioned (though it might be confusing with the current
>> meaning of `:signature' as a D-Bus type "g").
>
> I'm OK with :type, as you said it is similar to what defcustom
> offers. :signature would be confusing indeed, when it means Lisp
> objects instead of a signature string.

Sorry for the long delay.  I have tried to implement it (patch
attached).  It basically adds a couple of new functions:

- xd_type_spec_to_signature(char *, Lisp_Object)
- xd_append_arg_with_type_spec(Lisp_Object, Lisp_Object, DBusMessageIter *)

which are similar to xd_signature and xd_append_arg, but take a
Lisp_Object denoting an argument type.

Comments appreciated.

Regards,
-- 
Daiki Ueno

--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-dbusbind-Add-alternative-form-for-compound-args.patch

From 064aaaadd84310e4fd9beaa3d5c0fb74a70c4e92 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@HIDDEN>
Date: Thu, 27 Aug 2015 17:06:19 +0900
Subject: [PATCH] dbusbind: Add alternative form for compound args

* src/dbusbind.c (xd_append_basic_arg): New function, split from
xd_append_arg.
(xd_append_arg): Use xd_append_arg.
(xd_type_spec_to_signature): New function.
(xd_append_arg_with_type_spec): New function.
(Fdbus_message_internal): Use xd_append_arg_with_type_spec,
instead of xd_append_arg.
(syms_of_dbusbind): Provide subfeature `:type'.
* doc/misc/dbus.texi (Type Conversion): Mention `:type' keyword.

Fixes: debbugs:20193
---
 doc/misc/dbus.texi |  17 ++++-
 src/dbusbind.c     | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 204 insertions(+), 12 deletions(-)

diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi
index 5dd8bf2..03feecc 100644
--- a/doc/misc/dbus.texi
+++ b/doc/misc/dbus.texi
@@ -1030,7 +1030,22 @@ corresponding D-Bus container.  @code{:array} is optional, because
 this is the default compound D-Bus type for a list.
 
 The objects being elements of the list are checked according to the
-D-Bus compound type rules.
+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}))
+@end lisp
+
+There is an alternative form to specify the type of the following
+compound type argument, using the keyword @code{:type} followed by a
+type specifier, which denotes a compound type as a list of type symbols.
+
+The above example is equivalent to:
+
+@lisp
+(dbus-call-method @dots{} :type '(:array :int32) '(@var{NAT-NUMBER} @var{NAT-NUMBER}))
+@end lisp
 
 @itemize
 @item An array must contain only elements of the same D-Bus type.  It
diff --git a/src/dbusbind.c b/src/dbusbind.c
index be1b890..81b6c27 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -567,18 +567,9 @@ xd_extract_unsigned (Lisp_Object x, uintmax_t hi)
     args_out_of_range_3 (x, make_number (0), make_fixnum_or_float (hi));
 }
 
-/* Append C value, extracted from Lisp OBJECT, to iteration ITER.
-   DTYPE must be a valid DBusType.  It is used to convert Lisp
-   objects, being arguments of `dbus-call-method' or
-   `dbus-send-signal', into corresponding C values appended as
-   arguments to a D-Bus message.  */
 static void
-xd_append_arg (int dtype, Lisp_Object object, DBusMessageIter *iter)
+xd_append_basic_arg (int dtype, Lisp_Object object, DBusMessageIter *iter)
 {
-  char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH];
-  DBusMessageIter subiter;
-
-  if (XD_BASIC_DBUS_TYPE (dtype))
   switch (dtype)
     {
     case DBUS_TYPE_BYTE:
@@ -703,7 +694,21 @@ xd_append_arg (int dtype, Lisp_Object object, DBusMessageIter *iter)
 	return;
       }
     }
+}
+
+/* Append C value, extracted from Lisp OBJECT, to iteration ITER.
+   DTYPE must be a valid DBusType.  It is used to convert Lisp
+   objects, being arguments of `dbus-call-method' or
+   `dbus-send-signal', into corresponding C values appended as
+   arguments to a D-Bus message.  */
+static void
+xd_append_arg (int dtype, Lisp_Object object, DBusMessageIter *iter)
+{
+  char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH];
+  DBusMessageIter subiter;
 
+  if (XD_BASIC_DBUS_TYPE (dtype))
+    xd_append_basic_arg (dtype, object, iter);
   else /* Compound types.  */
     {
 
@@ -792,6 +797,161 @@ xd_append_arg (int dtype, Lisp_Object object, DBusMessageIter *iter)
     }
 }
 
+static void
+xd_type_spec_to_signature (char *signature, Lisp_Object spec)
+{
+  int dtype;
+
+  if (SYMBOLP (spec))
+    {
+      dtype = xd_symbol_to_dbus_type (spec);
+      if (!XD_BASIC_DBUS_TYPE (dtype))
+	wrong_type_argument (intern ("D-Bus"), spec);
+      sprintf (signature, "%c", dtype);
+    }
+  else /* Compound types.  */
+    {
+      char *subsig;
+      char x[DBUS_MAXIMUM_SIGNATURE_LENGTH];
+      Lisp_Object elt;
+
+      CHECK_CONS (spec);
+
+      dtype = xd_symbol_to_dbus_type (CAR (spec));
+      elt = CDR_SAFE (spec);
+
+      switch (dtype)
+	{
+	case DBUS_TYPE_ARRAY:
+	  sprintf (signature, "%c", dtype);
+	  if (NILP (elt))
+	    /* If the array is empty, DBUS_TYPE_STRING is the default
+	       element type.  */
+	    subsig = DBUS_TYPE_STRING_AS_STRING;
+	  else
+	    {
+	      xd_type_spec_to_signature (x, CAR_SAFE (elt));
+	      subsig = x;
+	    }
+	  xd_signature_cat (signature, subsig);
+	  break;
+
+	case DBUS_TYPE_VARIANT:
+	  sprintf (signature, "%c", dtype);
+	  break;
+
+	case DBUS_TYPE_STRUCT:
+	  sprintf (signature, "%c", DBUS_STRUCT_BEGIN_CHAR);
+	  while (!NILP (elt))
+	    {
+	      xd_type_spec_to_signature (x, CAR_SAFE (elt));
+	      xd_signature_cat (signature, x);
+	      elt = CDR_SAFE (elt);
+	    }
+	  xd_signature_cat (signature, DBUS_STRUCT_END_CHAR_AS_STRING);
+	  break;
+
+	case DBUS_TYPE_DICT_ENTRY:
+	  sprintf (signature, "%c", DBUS_DICT_ENTRY_BEGIN_CHAR);
+	  while (!NILP (elt))
+	    {
+	      xd_type_spec_to_signature (x, CAR_SAFE (elt));
+	      xd_signature_cat (signature, x);
+	      elt = CDR_SAFE (elt);
+	    }
+	  xd_signature_cat (signature, DBUS_DICT_ENTRY_END_CHAR_AS_STRING);
+	  break;
+
+	default:
+	  wrong_type_argument (intern ("D-Bus"), spec);
+	}
+    }
+}
+
+static void
+xd_append_arg_with_type_spec (Lisp_Object spec, Lisp_Object object,
+			      DBusMessageIter *iter)
+{
+  int dtype;
+
+  if (SYMBOLP (spec))
+    {
+      dtype = xd_symbol_to_dbus_type (spec);
+      if (!XD_BASIC_DBUS_TYPE (dtype))
+	wrong_type_argument (intern ("D-Bus"), spec);
+      xd_append_basic_arg (dtype, object, iter);
+    }
+  else /* Compound types.  */
+    {
+      char signature[DBUS_MAXIMUM_SIGNATURE_LENGTH];
+      DBusMessageIter subiter;
+      int subtype;
+      Lisp_Object subspec;
+      Lisp_Object elt;
+
+      CHECK_CONS (spec);
+
+      dtype = xd_symbol_to_dbus_type (CAR (spec));
+      elt = CDR_SAFE (spec);
+
+      /* Open new subiteration.  */
+      switch (dtype)
+	{
+	case DBUS_TYPE_ARRAY:
+	  if (NILP (elt))
+	    /* If the array is empty, DBUS_TYPE_STRING is the default
+	       element type.  */
+	    subspec = QCdbus_type_string;
+	  else
+	    subspec = CAR_SAFE (elt);
+	  xd_type_spec_to_signature (signature, subspec);
+	  if (!dbus_message_iter_open_container (iter, dtype,
+						 signature, &subiter))
+	    XD_SIGNAL3 (build_string ("Cannot open container"),
+			make_number (dtype), build_string (signature));
+	  break;
+
+	case DBUS_TYPE_VARIANT:
+	  /* A variant has just one element.  */
+	  subspec = CAR_SAFE (elt);
+	  xd_type_spec_to_signature (signature, subspec);
+
+	  if (!dbus_message_iter_open_container (iter, dtype,
+						 signature, &subiter))
+	    XD_SIGNAL3 (build_string ("Cannot open container"),
+			make_number (dtype), build_string (signature));
+	  break;
+
+	case DBUS_TYPE_STRUCT:
+	case DBUS_TYPE_DICT_ENTRY:
+	  /* These containers do not require a signature.  */
+	  subspec = CAR_SAFE (elt);
+	  xd_type_spec_to_signature (signature, subspec);
+
+	  if (!dbus_message_iter_open_container (iter, dtype, NULL, &subiter))
+	    XD_SIGNAL2 (build_string ("Cannot open container"),
+			make_number (dtype));
+	  break;
+
+	default:
+	  wrong_type_argument (intern ("D-Bus"), list2 (spec, object));
+	}
+
+      /* Loop over list elements.  */
+      while (!NILP (object))
+	{
+	  xd_append_arg_with_type_spec (subspec, CAR_SAFE (object), &subiter);
+
+	  object = CDR_SAFE (object);
+	}
+
+      /* Close the subiteration.  */
+      if (!dbus_message_iter_close_container (iter, &subiter))
+	XD_SIGNAL2 (build_string ("Cannot close container"),
+		    make_number (dtype));
+    }
+}
+
 /* Retrieve C value from a DBusMessageIter structure ITER, and return
    a converted Lisp object.  The type DTYPE of the argument of the
    D-Bus message must be a valid DBusType.  Compound D-Bus types
@@ -1443,6 +1603,13 @@ usage: (dbus-message-internal &rest REST)  */)
   /* Append parameters to the message.  */
   for (; count < nargs; ++count)
     {
+      if (EQ (args[count], QCdbus_type_type))
+	{
+	  xd_append_arg_with_type_spec (args[count+1], args[count+2], &iter);
+	  count += 2;
+	}
+      else
+	{
 	  dtype = XD_OBJECT_TO_DBUS_TYPE (args[count]);
 	  if (XD_DBUS_TYPE_P (args[count]))
 	    {
@@ -1466,6 +1633,7 @@ usage: (dbus-message-internal &rest REST)  */)
 
 	  xd_append_arg (dtype, args[count], &iter);
 	}
+    }
 
   if (!NILP (handler))
     {
@@ -1718,6 +1886,8 @@ init_dbusbind (void)
 void
 syms_of_dbusbind (void)
 {
+  Lisp_Object subfeatures = Qnil;
+
   defsubr (&Sdbus__init_bus);
   defsubr (&Sdbus_get_unique_name);
 
@@ -1759,6 +1929,9 @@ syms_of_dbusbind (void)
   DEFSYM (QCdbus_type_struct, ":struct");
   DEFSYM (QCdbus_type_dict_entry, ":dict-entry");
 
+  /* Lisp symbol to indicate explicit typing of the following parameter.  */
+  DEFSYM (QCdbus_type_type, ":type");
+
   /* Lisp symbols of objects in `dbus-registered-objects-table'.  */
   DEFSYM (QCdbus_registered_serial, ":serial");
   DEFSYM (QCdbus_registered_method, ":method");
@@ -1866,7 +2039,11 @@ be called when the D-Bus reply message arrives.  */);
   xd_registered_buses = Qnil;
   staticpro (&xd_registered_buses);
 
-  Fprovide (intern_c_string ("dbusbind"), Qnil);
+  /* Add subfeature `:type'.  */
+  subfeatures = pure_cons (pure_cons (QCdbus_type_type, pure_cons (Qt, Qnil)),
+			   subfeatures);
+
+  Fprovide (intern_c_string ("dbusbind"), subfeatures);
 
 }
 
-- 
2.4.3


--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 27 Mar 2015 07:40:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 27 03:40:24 2015
Received: from localhost ([127.0.0.1]:37780 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YbOsS-00047U-AS
	for submit <at> debbugs.gnu.org; Fri, 27 Mar 2015 03:40:24 -0400
Received: from mout.gmx.net ([212.227.17.20]:62989)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <michael.albinus@HIDDEN>) id 1YbOsO-00047D-20
 for 20193 <at> debbugs.gnu.org; Fri, 27 Mar 2015 03:40:20 -0400
Received: from detlef.gmx.de ([87.146.35.16]) by mail.gmx.com (mrgmx101) with
 ESMTPSA (Nemesis) id 0Lwnem-1ZZ2uK4984-016Ood;
 Fri, 27 Mar 2015 08:40:13 +0100
From: Michael Albinus <michael.albinus@HIDDEN>
To: Daiki Ueno <ueno@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
 <m38ueiaofh.fsf-ueno@HIDDEN>
Date: Fri, 27 Mar 2015 08:40:11 +0100
In-Reply-To: <m38ueiaofh.fsf-ueno@HIDDEN> (Daiki Ueno's message of "Fri, 27
 Mar 2015 16:29:22 +0900")
Message-ID: <874mp628is.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:zFrXCDLDxABiKX+MXl20bFhSa++ZHiAFWJ3XslJmkYLm+GYTvh6
 /4i2Xivqi5zwIi/WgwmllRbQswO3ZN01U4iqzcnL/D13S5hq8Q8WnS8n1pE5aAnmEVfiMFv
 4+GSwdSJV3ITXYs11vd9X9ajfbZm99auu/AjKwRjge3+lCk8goq8wUS9PWo1TttaDjk14UE
 OZvGpqU3NEFRCR81o91vA==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Daiki Ueno <ueno@HIDDEN> writes:

> Certainly.  Do you have any preference on the alternative form?  My
> example used the `:type' keyword, but it was a tentative plan and might
> be too verbose for programmers.  Reusing `:signature' might be a better
> idea as you mentioned (though it might be confusing with the current
> meaning of `:signature' as a D-Bus type "g").

I'm OK with :type, as you said it is similar to what defcustom
offers. :signature would be confusing indeed, when it means Lisp
objects instead of a signature string.

> Regards,
> --
> Daiki Ueno

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 27 Mar 2015 07:29:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 27 03:29:29 2015
Received: from localhost ([127.0.0.1]:37776 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YbOhs-0003q8-VB
	for submit <at> debbugs.gnu.org; Fri, 27 Mar 2015 03:29:29 -0400
Received: from fencepost.gnu.org ([208.118.235.10]:57691 ident=Debian-exim)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ueno@HIDDEN>) id 1YbOhq-0003pr-O2
 for 20193 <at> debbugs.gnu.org; Fri, 27 Mar 2015 03:29:27 -0400
Received: from du-a.org ([2001:e41:db5e:fb14::1]:36299
 helo=localhost.localdomain)
 by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <ueno@HIDDEN>)
 id 1YbOhp-0005nF-QF; Fri, 27 Mar 2015 03:29:26 -0400
Message-ID: <m38ueiaofh.fsf-ueno@HIDDEN>
From: Daiki Ueno <ueno@HIDDEN>
To: Michael Albinus <michael.albinus@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN> <87bnjgat6z.fsf@HIDDEN>
Date: Fri, 27 Mar 2015 16:29:22 +0900
In-Reply-To: <87bnjgat6z.fsf@HIDDEN> (Michael Albinus's message of "Thu, 26
 Mar 2015 12:34:12 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

Michael Albinus <michael.albinus@HIDDEN> writes:

> In the early design phase of dbus.el I have played with explicit
> signatures for the arguments, like
>
>   (dbus-call-method :session
>                     "org.example.Foo"
>                     "/org/example/Foo"
>                     "org.example.Foo"
>                     "Test"
>                     :signature "a{si}"
>                     '(("a" 1) ("b" 2)))
>
> which is similar to your proposal, with other means. I haven't
> implemented it, because I found it to strict for Lisp developers to
> think in D-Bus signatures. It has only survived for marking the type of
> an empty array.
>
> Your proposal is closer to the developers, so it has charm. There is
> also a minor difference how dict entries are expressed, but that could
> be agreed. So I'm open to this, as an *alternative* option to the
> existing spec. We don't want to break existing code.

Certainly.  Do you have any preference on the alternative form?  My
example used the `:type' keyword, but it was a tentative plan and might
be too verbose for programmers.  Reusing `:signature' might be a better
idea as you mentioned (though it might be confusing with the current
meaning of `:signature' as a D-Bus type "g").

>> Would this kind of change be considered?  As a proof-of-concept, I'm
>> attaching a small Elisp snippet that augments the argument value with
>> the given type information (though I guess it should be implemented in
>> the C level, to avoid duplication of signature computation code).
>
> IIRC, this was another reason that I haven't followed the :signature
> approach - it was harder to implement in dbusbind.c. But this is years
> ago, maybe my memories are wrong.
>
> Yes, it shall be implemented in dbusbind.c - would you like to try it?

Sure.

> Btw, one of your examples is wrong (or at least misleading). An empty
> array must contain exactly one element of type signature. The case you
> have shown here indicates, that '(:array :signature "sig") is an array
> with exact one elemt, a signature. Although possible in D-Bus, this is
> not possible in dbus.el (maybe a design flaw?). Your example could be
> therefore changed to
>
> ;; (dbus--annotate-arg '(:struct :object-path (:array (:dict-entry
> string :int32)) :string)
> ;;                     '("path" nil "password"))
> ;; ;=> ((:struct :object-path "path" (:array :signature "{si}")
> :string "password"))
>
> This would require additional mapping of the type symbols to signature
> strings - something what exist in dbusbind.c already.

Oh, I see.  Thanks for the info.

Regards,
--
Daiki Ueno




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at 20193 <at> debbugs.gnu.org:


Received: (at 20193) by debbugs.gnu.org; 26 Mar 2015 11:34:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 26 07:34:28 2015
Received: from localhost ([127.0.0.1]:37070 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yb63P-0007oC-Fx
	for submit <at> debbugs.gnu.org; Thu, 26 Mar 2015 07:34:27 -0400
Received: from mout.gmx.net ([212.227.15.19]:56681)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <michael.albinus@HIDDEN>) id 1Yb63N-0007ny-AZ
 for 20193 <at> debbugs.gnu.org; Thu, 26 Mar 2015 07:34:26 -0400
Received: from detlef.gmx.de ([79.195.20.186]) by mail.gmx.com (mrgmx001) with
 ESMTPSA (Nemesis) id 0MLvGW-1Ya07N3TRs-007pjq;
 Thu, 26 Mar 2015 12:34:13 +0100
From: Michael Albinus <michael.albinus@HIDDEN>
To: Daiki Ueno <ueno@HIDDEN>
Subject: Re: bug#20193: 25.0.50; declarative type specification for D-Bus args
References: <m3lhilu50q.fsf-ueno@HIDDEN>
Date: Thu, 26 Mar 2015 12:34:12 +0100
In-Reply-To: <m3lhilu50q.fsf-ueno@HIDDEN> (Daiki Ueno's message of "Wed, 25
 Mar 2015 12:31:33 +0900")
Message-ID: <87bnjgat6z.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K0:VBsAoLOFDaaNhfYN6sFB4Wcgf4/uXe1RbgLPGN+m2+5YDlF5plP
 rxHaE96OpNMME8LtXaJpjp693KDQdv0fOHpGCN9jcxyo6HuacgT9rI5D9O8ILjIMocu5+2s
 /GzpK8MMDnOZeTRsj+brk5u7hAbiJ12ynV0qKu7IjgRaDWaQeIVP/+32lhvbVce0YujcU65
 DP1BYqdSomnlpMKeC9zng==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20193
Cc: 20193 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

Daiki Ueno <ueno@HIDDEN> writes:

> Hello Michael,

Hi,

> Suppose a simple D-Bus signature "a{si}".  Since dbusbind treats positive
> integers as uint32, one would need to write:
>
> So I would like to propose an alternative syntax, similar to the `:type'
> keyword of `defcustom', like this:
>
>   (dbus-call-method :session
>                     "org.example.Foo"
>                     "/org/example/Foo"
>                     "org.example.Foo"
>                     "Test"
>                     '(:type (:array (:dict-entry :string :int32)))
>                     '(("a" . 1) ("b" . 2)))

In the early design phase of dbus.el I have played with explicit
signatures for the arguments, like

  (dbus-call-method :session
                    "org.example.Foo"
                    "/org/example/Foo"
                    "org.example.Foo"
                    "Test"
                    :signature "a{si}"
                    '(("a" 1) ("b" 2)))

which is similar to your proposal, with other means. I haven't
implemented it, because I found it to strict for Lisp developers to
think in D-Bus signatures. It has only survived for marking the type of
an empty array.

Your proposal is closer to the developers, so it has charm. There is
also a minor difference how dict entries are expressed, but that could
be agreed. So I'm open to this, as an *alternative* option to the
existing spec. We don't want to break existing code.

> Would this kind of change be considered?  As a proof-of-concept, I'm
> attaching a small Elisp snippet that augments the argument value with
> the given type information (though I guess it should be implemented in
> the C level, to avoid duplication of signature computation code).

IIRC, this was another reason that I haven't followed the :signature
approach - it was harder to implement in dbusbind.c. But this is years
ago, maybe my memories are wrong.

Yes, it shall be implemented in dbusbind.c - would you like to try it?

Btw, one of your examples is wrong (or at least misleading). An empty
array must contain exactly one element of type signature. The case you
have shown here indicates, that '(:array :signature "sig") is an array
with exact one elemt, a signature. Although possible in D-Bus, this is
not possible in dbus.el (maybe a design flaw?). Your example could be
therefore changed to

;; (dbus--annotate-arg '(:struct :object-path (:array (:dict-entry string :int32)) :string)
;;                     '("path" nil "password"))
;; ;=> ((:struct :object-path "path" (:array :signature "{si}") :string "password"))

This would require additional mapping of the type symbols to signature
strings - something what exist in dbusbind.c already.

> Regards,

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Mar 2015 03:31:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 24 23:31:51 2015
Received: from localhost ([127.0.0.1]:35436 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yac2o-0004wM-Pd
	for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 23:31:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52748)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <ueno@HIDDEN>) id 1Yac2l-0004w8-W4
 for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 23:31:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ueno@HIDDEN>) id 1Yac2f-0004mN-PO
 for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 23:31:42 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:42945)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ueno@HIDDEN>)
 id 1Yac2f-0004mJ-MT
 for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 23:31:41 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54465)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <ueno@HIDDEN>) id 1Yac2e-0007Nf-If
 for bug-gnu-emacs@HIDDEN; Tue, 24 Mar 2015 23:31:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <ueno@HIDDEN>) id 1Yac2d-0004ll-IJ
 for bug-gnu-emacs@HIDDEN; Tue, 24 Mar 2015 23:31:40 -0400
Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33195)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <ueno@HIDDEN>)
 id 1Yac2d-0004lh-Ez
 for bug-gnu-emacs@HIDDEN; Tue, 24 Mar 2015 23:31:39 -0400
Received: from du-a.org ([2001:e41:db5e:fb14::1]:35886
 helo=localhost.localdomain)
 by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <ueno@HIDDEN>)
 id 1Yac2c-0006Nm-DZ; Tue, 24 Mar 2015 23:31:39 -0400
Message-ID: <m3lhilu50q.fsf-ueno@HIDDEN>
From: Daiki Ueno <ueno@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 25.0.50; declarative type specification for D-Bus args
Date: Wed, 25 Mar 2015 12:31:33 +0900
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
Cc: Michael Albinus <michael.albinus@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

--=-=-=
Content-Type: text/plain

Severity: wishlist

Hello Michael,

While using dbus.el, I found it a bit cumbersome to specify type symbols
for the arguments of dbus-call-method and dbus-send-signal.

Suppose a simple D-Bus signature "a{si}".  Since dbusbind treats positive
integers as uint32, one would need to write:

  (dbus-call-method :session
                    "org.example.Foo"
                    "/org/example/Foo"
                    "org.example.Foo"
                    "Test"
                    '(:array
                       (:dict-entry :string "a" :int32 1)
                       (:dict-entry :string "b" :int32 2)))

This is simple if the arguments are "fixed", but if one wants a wrapper,
she would need to write a loop by herself.

  (defun example-foo (alist)
    (dbus-call-method :session
                      "org.example.Foo"
                      "/org/example/Foo"
                      "org.example.Foo"
                      "Test"
                      (list :array
                            (mapcar (lambda (entry)
                                      (list :dict-entry
                                            :string (car entry)
                                            :int32 (cdr entry)))
                                    alist))))

So I would like to propose an alternative syntax, similar to the `:type'
keyword of `defcustom', like this:

  (dbus-call-method :session
                    "org.example.Foo"
                    "/org/example/Foo"
                    "org.example.Foo"
                    "Test"
                    '(:type (:array (:dict-entry :string :int32)))
                    '(("a" . 1) ("b" . 2)))

That is, if a type symbol is a cons cell and the car is :type, treat the
cdr as the type specification of the following value.

The the wrapper can be written as:

  (defun example-foo (alist)
    (dbus-call-method :session
                      "org.example.Foo"
                      "/org/example/Foo"
                      "org.example.Foo"
                      "Test"
                      '(:type (:array (:dict-entry :string :int32)))
                      alist))

Would this kind of change be considered?  As a proof-of-concept, I'm
attaching a small Elisp snippet that augments the argument value with
the given type information (though I guess it should be implemented in
the C level, to avoid duplication of signature computation code).

Comments appreciated.

Regards,
-- 
Daiki Ueno

--=-=-=
Content-Type: text/plain
Content-Disposition: inline; filename=dbus--annotate-arg.el

;; (setq lexical-binding t)

;; (dbus--annotate-arg '(:array :int32) '(1 2 3))
;; ;=> ((:array :int32 1 :int32 2 :int32 3))

;; (dbus--annotate-arg '(:array (:dict-entry :string :int32)) '(("a" . 1) ("b" . 2)))
;; ;=> ((:array (:dict-entry :string "a" :int32 1) (:dict-entry :string "b" :int32 2)))

;; (dbus--annotate-arg '(:struct :object-path (:array :signature) :string)
;;                     '("path" ("sig") "password"))
;; ;=> ((:struct :object-path "path" (:array :signature "sig") :string "password"))

(defun dbus--annotate-arg (type arg)
  (pcase type
    ((and basic (or :byte :boolean :int16 :uint16 :int32 :uint32
		    :double :string :object-path :signature :unix-fd))
     (list basic arg))
    (`(:array ,elttype)
     (list (cons :array (apply #'nconc
			       (mapcar (lambda (subarg)
					 (dbus--annotate-arg elttype subarg))
				       arg)))))
    (`(,(and symbol (or :variant :struct)) . ,memtypes)
     (list (cons symbol (apply #'nconc
			       (cl-mapcar
				(lambda (memtype subarg)
				  (dbus--annotate-arg memtype subarg))
				memtypes arg)))))
    (`(:dict-entry ,keytype ,valtype)
     (list (cons :dict-entry (nconc (dbus--annotate-arg keytype (car arg))
			      (dbus--annotate-arg valtype (cdr arg))))))
    (_ (error "Unknown type specification: %S" type))))

--=-=-=--




Acknowledgement sent to Daiki Ueno <ueno@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#20193; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 18 Sep 2020 13:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.