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: Mon, 07 Sep 2020 20:00:43 +0200 Message-ID: <87sgbtcvqs.fsf@gmx.de> References: <87v9gqquct.fsf@ccss.com> <87imcqdo38.fsf@gmx.de> <87sgbtqylc.fsf@ccss.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30624"; 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 Mon Sep 07 20:01:33 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 1kFLSO-0007r1-TZ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 07 Sep 2020 20:01:33 +0200 Original-Received: from localhost ([::1]:42386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFLSN-0002AQ-Ha for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 07 Sep 2020 14:01:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFLRu-0002AF-2V for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2020 14:01:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFLRt-00022K-Q5 for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2020 14:01:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kFLRt-0001Gq-Ok for bug-gnu-emacs@gnu.org; Mon, 07 Sep 2020 14:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Sep 2020 18:01:01 +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.15995016544864 (code B ref 43252); Mon, 07 Sep 2020 18:01:01 +0000 Original-Received: (at 43252) by debbugs.gnu.org; 7 Sep 2020 18:00:54 +0000 Original-Received: from localhost ([127.0.0.1]:50774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFLRm-0001GO-BW for submit@debbugs.gnu.org; Mon, 07 Sep 2020 14:00:54 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:51949) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kFLRk-0001GB-6V for 43252@debbugs.gnu.org; Mon, 07 Sep 2020 14:00:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599501644; bh=TD3iihpeycuK1HPKKh/zLwOVK2/mBo9M+39yOBQYQQM=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=ZLv/voCvCtaHr/ScS+UKHeO4GCEHveEgfvFzTSAIboVurzycz6SAJ0FjPuupw+Mz5 1tUREXB8KzyMt8oj8XlkowCKqOhNdKpjhcDYt6kSkusFvQhMR6bZG2EwWTZi5dLA3P YQUK36DiRI2vfBhFvIEkCEyylN6OWvhHpCSl39hE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([212.91.238.230]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MMobU-1jwZZY17wa-00IpRT; Mon, 07 Sep 2020 20:00:44 +0200 In-Reply-To: <87sgbtqylc.fsf@ccss.com> (Hugh Daschbach's message of "Mon, 07 Sep 2020 10:35:27 -0700") X-Provags-ID: V03:K1:RzmFmHmwPIrK+Fvg5t02SxM86bYQ//q/h/aZ11qzEHYLMg5VWro le//OeqVrEmndYDuNg/INkteaCcXyOBy06cOHyMnEi1QKqJG3OEGZgkHW/XN7nzakTJz7Xc iT54fwgoxR4WFhMexZ/lPRMiMfbOOTtpxMzwpFRnqGEQ7DXj40AzztWUfZRlimEv9JaXqmc OkNQ2vIxzLgFf9scWuioA== X-UI-Out-Filterresults: notjunk:1;V03:K0:CeTJMYDwzyw=:k9soPYnzNXZHD4aWZR9EKE mW40letxz+OL/qcZlCu9Zp0H7k+MkiU5OqczxZgRSDHQeFBZQCdDnGnDfHpdFwDY7blxNVwm+ m50GeFdKnNSFnUWOoJ+lnjHXItTx9sYoQRw85b5Ot6VLoxa0sVOmsTc3OSuTpCMj9ZMejUFv9 AN+vkTnkb4Dsi/6UVVkFSbjEsqyA1oWaFBXpWKG7jb8v9DVQNPFf9fsxCU8XhmApwm4Utc0q+ 0HpNfrapxn+6Ny24O+KlUYdISBcFDKAkc6nExuC6hTmOaYoVKXwYm9C0sKG/cDyth1GC/hSzV STo2FqetX+Yvk7yaS+cOcYDH8cRavlpAFJ0EnRikRBSHF3vG9Bv2G1qr9Q/zyVmIhoyXWRxF/ KgWX4PIMYQTrP5WiJS8l/adnnYUGcofTHAOPC9DxjqlBqTGVxCur9muIeYlbhUvB6FscgKclU xsOCQZMIbBvs6zpqtiQ2EeRZybia+BunxJQ8luHttPNODi98qLHzRYMxH7mIC23Xie6NOU1u1 4DswDOBlXlTa4Z4DbYEF555tIZ7ml2/SBKJQGMiVRkpiWzYc+beZ6LGucETdlqw7a/BAGUGJy HUzyiGlGhw+WYaB0fBtGmBMqkURqN+V3ka86Tst4W5B5skMbFMkX4NytOgYtsBiB/8UwiPz8e oifpF4tDIoChnvFqkNJzY5MPxEAD9pc/Fj7KOEnxggLTwzu+lx5i5GaPmPMABRW0g9t1HN1c7 PAkaS9ZWuCOlPAx/Ygw+CHM8nV1rJ6jCIumGvVDW/s8ar2BYrZBXYWezxi9+1fAIIDAtOjMD 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:187466 Archived-At: Hugh Daschbach writes: Hi Hugh, >>> There doesn't seem to be any mechanism to register the property and >>> have >>> introspection describe it as as an :object-path. >>> >> >> Confirmed. In `dbus-registered-objects-table', properties are stored >> w/o >> signature. An object path is stored as string, and dbus-get-property >> returns a string. >> >> Introspection data could be used if exists (like in your case). But >> they >> are optional, so one cannot trust on their existence. Maybe we could >> say >> that, in absence of introspection data, ofD.Properties.Get and >> ofD.Properties.GetAll shall return a default type, like string in >> case >> of object paths? Then it would be the responsibility of the user to >> provide proper introspection data if needed. >> > > I had considered an optional or keyword argument to > dbus-register-property, but I like introspection even more. Then the > application simply registers ofD.Introspectable.Introspect for each of > its objects? I'm just sitting at this. Yes, introspection data is the best way to go. I've already extended dbus-introspect-get-signature to support also properties (it does already work for methods and signals, modulo a bug I have fixed this way). Looks promising. > Introspect returns XML. The SEXP that dbus-introspect-xml returns is > easier to work with. Sure. But there are several helper functions, like the just mentioned dbus-introspect-get-signature. Have a look at dbus.el; not everything is documented. (And since I'm bad in documentation; comments for improvements are appreciated) > So do you memoize the returned value? There may not be enough > overhead to be concerned. I'm just trying to imagine what overhead > would be introduced. Not yet. But in case of performance problems, we could indeed do caching. > I'm looking at emulating a Bluetooth keyboard. So I'm anticipating > bursty property updates on the order of tens per second. User > initiated, rather than continuous background activity. But I don't > want to bog the system down. An introspection per property update > probably isn't much to worry about. My experience is that method calls are very responsive. But I haven't tested with bulk data yet, we'll see. Another problem: The changes I apply do not qualify as bug fixing any longer, so I fear they are not applicable to Emacs 27. I'm working on Emacs' master branch (what will be Emacs 28 later), the patches I have provided to you were backports. Do you have a chance to use Emacs' master branch? This will avoid discussions with the maintainers whether those changes are good for Emacs 27, and it will simplify my life considerably, because the sources for D-Bus in Emacs 27 and 28 differ. I have even applied changes to dbusbind.c, which means it would be harder for you to integrate my patches into Emacs 27. > Cheer, > Hugh Best regards, Michael.