From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#43252: 27.1; DBus properties lack type hints or overrides Date: Wed, 23 Sep 2020 19:32:08 +0200 Message-ID: <87wo0kielj.fsf@gmx.de> References: <87v9gqquct.fsf@ccss.com> <878sdj84kn.fsf@gmx.de> <871rjbaq05.fsf@ccss.com> <874ko6979w.fsf@gmx.de> <87v9gm9x9i.fsf@ccss.com> <871rj9k78r.fsf@gmx.de> <87imclwow5.fsf@gmx.de> <87pn6t9rbq.fsf@ccss.com> <87y2lggzvd.fsf@gmx.de> <87h7rzadlo.fsf@ccss.com> <87k0wtrir2.fsf@gmx.de> <87een19x9n.fsf@ccss.com> <87a6xor25b.fsf@gmx.de> <87bli49rem.fsf@ccss.com> <87h7rva0ku.fsf@gmx.de> <875z8aa1bm.fsf@ccss.com> <87ft7c8p4k.fsf@gmx.de> <87imc7jqms.fsf@gmx.de> <87zh5i8o9h.fsf@ccss.com> <87eemt67eg.fsf@gmx.de> <87wo0l8908.fsf@ccss.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7703"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 43252@debbugs.gnu.org To: Hugh Daschbach Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 23 19:33:58 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kL8eU-0001rS-B1 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Sep 2020 19:33:58 +0200 Original-Received: from localhost ([::1]:58898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kL8eT-0004Th-5b for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Sep 2020 13:33:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kL8da-0004TL-Fg for bug-gnu-emacs@gnu.org; Wed, 23 Sep 2020 13:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kL8da-00027E-6X for bug-gnu-emacs@gnu.org; Wed, 23 Sep 2020 13:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kL8da-00040v-3r for bug-gnu-emacs@gnu.org; Wed, 23 Sep 2020 13:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Sep 2020 17:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43252 X-GNU-PR-Package: emacs Original-Received: via spool by 43252-submit@debbugs.gnu.org id=B43252.160088234315359 (code B ref 43252); Wed, 23 Sep 2020 17:33:02 +0000 Original-Received: (at 43252) by debbugs.gnu.org; 23 Sep 2020 17:32:23 +0000 Original-Received: from localhost ([127.0.0.1]:37743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kL8cw-0003zf-LG for submit@debbugs.gnu.org; Wed, 23 Sep 2020 13:32:23 -0400 Original-Received: from mout.gmx.net ([212.227.15.19]:43129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kL8cr-0003zH-O1 for 43252@debbugs.gnu.org; Wed, 23 Sep 2020 13:32:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1600882329; bh=H6RLGfdk4dWCOyIjTzALMngWWfukz4Puj9CiQ90iNoM=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=bZce/+AR58v0G4E/YoZ6zaopzPGG4nXxU6ANczNK0GAf7+CfAx8Hg+1bC9HLmUy3r smUT6COHypGOkrVar5qTCxTJBsSPBTjjqNZT65QLLQFrd1rtvsSw5jUtCJRNydC+iw ChtqAEEXQ2Uob67aR9TItqaYKzQ0SXxCwnO1LyyI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([79.140.124.10]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M6Db0-1kNMbh2Ydk-006bMg; Wed, 23 Sep 2020 19:32:09 +0200 In-Reply-To: <87wo0l8908.fsf@ccss.com> (Hugh Daschbach's message of "Tue, 22 Sep 2020 20:30:47 -0700") X-Provags-ID: V03:K1:jbqYsIkVqbyE/H9mamVbZ0hWzLuzVmF+GAKnv23AnZp2BQNM1aA Uu7fbq31QBX6kwOmqCDzNkvGhnxaqCH6Kqh9CUA8L/oUsAzBGBWLIGE2/Gp/uHlebccK0uI oWSvVG1PSzWpU71UoWdchjsUOvstx+4cOQsV5Md3ebexr9SsdtCkm7Prx++vIKlgUWP4a6b ArKIcPLCieb3/DM61C1og== X-UI-Out-Filterresults: notjunk:1;V03:K0:9aym11tN4YU=:QNRvmp8bvDnZd6AvPP0bTK KyHM0yMksDJg272dMHJKdiEiHwcoew8ZPtxy9UupLVTo7jG8T6kxfEwg68S0s24+b71N/9gA5 r9AhI2M2NPlkwrS28G20n9VpcFH1zi6mtrMwQstlJmB2uZTSU5r/DgD4fx/Iw+PVLYJybWADH C945AiZhVxxm1k9FyPoMjqlifmWYIou9NNggKvPfIKmz9CojxU9Uk2HBNVP8zO4CUOwbijH23 rGIhlSO0eJequu3PF0mxpqyCAfQ9rhoDBCJq0tdjX+NJmDOYVxYiiwMf/urgGu2rs2auxYONc y6TahZ8gnVyQmFOWtvD/uUc9KOsTIHZn4nmDh5nFKe0A0in7DI+CHOttE3OM+XS783Y7/gG3j YxSUt7mvBIcgWVbmB/Z1nuWety8D+ayqbyYDNZfJ4/SnA8vnFlcXMBHcxMd/s/mc0q9PfM9bB 4rUIS1gE4f3c64oY3TWk5gOSapI3lF9FobyOY2JwESDjqUCIxgO5Jx+ZRIQl1QDLFAbi6k3YL dBqrzxWMWV8vpFL15wuncFszd5vVnlh8gyR+Cu9DlY2eudw9Ze8rGcVgSS2DPz18E9Zr+zywS 8XZ16/uTmeAqezmutsaSenj25Sz/AOlSb8ptTJcVoxo1O9Ym3//mjM5/PqUYyAld9GcuIXppy SG6RBO2EaxsNuhP/TRU5aG/P8q5rWg39G3JQ4OBmoY690D0gOgUN0QMFH1nQMv/riwIcWY7K9 vi5/e/R6Te/cskuCgw0T5tY7DVZhiBJX3reZkERFCMUgjcc7o5MmSR4pFKyZ3egFdpbc8f4Y X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188807 Archived-At: Hugh Daschbach writes: Hi Hugh, > I've taken a shot at this. I'm not sure I got the ChangeLog style > correct. Let me know if I'm still off the beaten path. Almost. See comment below. >> `dbus-register' (if SELECTOR is `register') or > > Fixed. Almost. See comment below. >> Well, this is one approach. Alternatively, we could regard the >> introspection file as test data, which is located in a file called >> .../test/lisp/net/dbus-tests/org.gnu.Emacs.TestDBus.xml. This >> function (the handler for the Introspect method) would read the file, >> and return its contents. Oops, I'm mistaken here. The directory shall be called dbus-resources, see .../test/file-organization.org. Sorry. > Is: > > (let* ((property > (dbus-introspect-get-property > :session > dbus--test-service > dbus--test-path interface > property-name))) ...) > > preferred over: > > (let* ((property > (dbus-introspect-get-property :session > dbus--test-service > dbus--test-path interface property-name))) > ...) > > If not, I'll take another bite at the apple. I'd vote for the latter, with the first argument :session preceding the other arguments in the same line. Like (let* ((property (dbus-introspect-get-property :session dbus--test-service dbus--test-path interface property-name))) ...) If all arguments fit into 80 columns, do it. The "canonical" formatting is offered by the `pp' command (pretty printer). I must confess, that I do not follow all its recommendations. > Done. =E2=80=99dbus-annotation-deprecated=E2=80=99. Let me know if you = think this > should be > =E2=80=98dbus--annotation-deprecated=E2=80=99 instead. No, the former is OK. People might want to use it in their packages. > In other news, this test: > > (should-error > (dbus-check-arguments :session dbus--test-service :unix-fd 10) > :type 'dbus-error) > > works for me in batch mode, but not interactive mode. > > On GNU/Linux, (dired (format "/proc/%s/fd" (emacs-pid))) indicates I > have 14 open file descriptors on a test instance (emacs -q -Q). On my > development instance, I've got 27 open file descriptors. I see. Will investigate. And now my review for the latest patch versions. > From be45a75b315e56649fa9e39d199fe5e2b50bf69d Mon Sep 17 00:00:00 2001 > From: Hugh Daschbach > Date: Tue, 22 Sep 2020 19:36:20 -0700 > Subject: [PATCH 1/2] Add D-Bus property tests. > > * test/lisp/net/dbus-tests.el: Add property tests. > (dbus--test-run-property-test) (dbus--test-property) > (dbus-test06-property-types): Test property registration, set, get. If you have one comment for several functions, use only one parenthesis per line like (dbus--test-run-property-test, dbus--test-property) (dbus-test06-property-types): Test property registration, set, get. > +(defsubst dbus--test-run-property-test (selector name value expected) > + "Generate a property test: register, set, get, getall sequence. > +This is a helper function for the macro `dbus--test-property'. > +The argument SELECTOR indicates whether the test should expand to > +'dbus-register-property' (if SELECTOR is `register') or `dbus-register-property' (if SELECTOR is `register') or > + '((:array > + :object-path "/node00" > + :object-path "/node01" > + :object-path "/node0/node02") . > + ("/node00" "/node01" "/node0/node02")) If a cons cell doesn't fit into one line, you shall move the dot "." to the beginning of the next line, like (dbus--test-property "ObjectArray" '((:array :object-path "/node00" :object-path "/node01" :object-path "/node0/node02") . ("/node00" "/node01" "/node0/node02")) I bet the dot "." has the font-lock-warning-face (red foreground color) in your buffer. Admittedly, it doesn't look prominent :-( Move the cursor over the misplaced dot; there shall be a help message about. > + ;; Cleanup. > + (message "cleanup") > + (dbus-unregister-service :session dbus--test-service))) I don't believe we need this message. We see that we're done :-) > From 3efb1b38d75572b14ac0526dbd79769d6fa89d10 Mon Sep 17 00:00:00 2001 > From: Hugh Daschbach > Date: Mon, 21 Sep 2020 17:12:49 -0700 > Subject: [PATCH 2/2] Add D-Bus Introspection tests. > > * lisp/net/dbus.el (new defconst): D-Bus deprecation name. > > * test/lisp/net/dbus-tests.el (dbus--tests-dir) > (dbus--test-introspect) (dbus--test-examine-interface) > (dbus--test-validate-annotations) (dbus--test-validate-property) > (dbus--test-validate-m-or-s) (dbus--test-validate-signal) > (dbus--test-validate-method) (dbus-test07-introspection): new tests. That's not true. All but the last functions are new defuns, not new tests. And please start the explanation with a capital letter, like "New te= st." > +(defconst dbus-annotation-deprecated (concat dbus-interface-dbus ".Depre= cated") > + "An annotation value indicating a deprecated interface, method, signal= , or property.") The docstring line does not fit 80 chars. What about "An annotation indicating a deprecated interface, method, signal, or proper= ty." > +(defvar dbus--tests-dir > + (file-truename > + (expand-file-name "dbus-tests" > + (file-name-directory (or load-file-name > + buffer-file-name)))) > + "Directory containing test data files.") As said, it must be "dbus-resources". > +(ert-deftest dbus-test07-introspection () > + :tags '(:expensive-test) > + "Register an Introspection interface then query it." :tags must be after the docstring. > Cheers, > Hugh Best regards, Michael.