From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hugh Daschbach Newsgroups: gmane.emacs.bugs Subject: bug#43252: 27.1; DBus properties lack type hints or overrides Date: Thu, 17 Sep 2020 11:42:09 -0700 Message-ID: <87bli49rem.fsf@ccss.com> References: <87v9gqquct.fsf@ccss.com> <87imcqdo38.fsf@gmx.de> <87sgbtqylc.fsf@ccss.com> <87sgbtcvqs.fsf@gmx.de> <87pn6xqtsz.fsf@ccss.com> <87363sl4hs.fsf@gmx.de> <877dt3bnfl.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> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27695"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.5; emacs 27.1 Cc: 43252@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 17 20:44:43 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 1kIyte-000712-Jz for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Sep 2020 20:44:42 +0200 Original-Received: from localhost ([::1]:44680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIytd-00076M-LX for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Sep 2020 14:44:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIys2-0005tj-27 for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 14:43:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55711) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIys1-0002dS-Og for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 14:43:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kIys1-0007Jc-Me for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 14:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Hugh Daschbach Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Sep 2020 18:43: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.160036814528077 (code B ref 43252); Thu, 17 Sep 2020 18:43:01 +0000 Original-Received: (at 43252) by debbugs.gnu.org; 17 Sep 2020 18:42:25 +0000 Original-Received: from localhost ([127.0.0.1]:39024 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIyrR-0007In-EJ for submit@debbugs.gnu.org; Thu, 17 Sep 2020 14:42:25 -0400 Original-Received: from mail1.ccss.com ([159.203.255.73]:52524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIyrP-0007IZ-2I for 43252@debbugs.gnu.org; Thu, 17 Sep 2020 14:42:23 -0400 Original-Received: by mail1.ccss.com (Postfix, from userid 114) id 4E300BF8CE; Thu, 17 Sep 2020 11:42:17 -0700 (PDT) Original-Received: from ccss.com (unknown [192.168.76.11]) by mail1.ccss.com (Postfix) with ESMTP id A4FCEBF8C0; Thu, 17 Sep 2020 11:42:16 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by ccss.com (Postfix) with ESMTP id 77AB217606CD; Thu, 17 Sep 2020 11:42:16 -0700 (PDT) Original-Received: from ccss.com ([127.0.0.1]) by localhost (ccss.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OKoumSrEl-nv; Thu, 17 Sep 2020 11:42:10 -0700 (PDT) Original-Received: from klaatu (klaatu.lan [192.168.42.3]) (Authenticated sender: hugh) by ccss.com (Postfix) with ESMTPSA id DF36217605C0; Thu, 17 Sep 2020 11:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ccss.com; s=mail; t=1600368129; bh=ZVopn/SAaO27AQN9xl65DALZYpc2c6VGWeEfBiw7fB4=; h=References:From:To:Cc:Subject:In-reply-to:Date:From; b=TV2WyDkU42ip/6hE7c267ZuR1B2dZMMlQvsrIUcZwsUKCtTUoehuiafPfRcjBRXpz WiOojb/RcHB8u1sgUUyO9mY/MKnOTMIzL2gwz4spWFCrHFmHGPZpKO3yYVBq0uKfZ4 3dFKoNUkjad9e4Fkw98uPd3tvleqfL+lkh4wochGcGH+GJXlTyY7X2fmzzB/MdGCZ/ X4VAE3lvcroOudFuP03edMnENsyfMZsnaD31GwpxHHw2blaTl3g+w3H/HsMYqC60N1 hLE7j1Z20GjNtqQCJTEki+lCiG1WtE6UJdPxYas8L15YBaUSZoJfPBQdVnRv/z7MvX eFv8DC2E6Meag== In-reply-to: <87a6xor25b.fsf@gmx.de> 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:188243 Archived-At: Michael Albinus writes: > Hugh Daschbach writes: > > Hi Hugh, > >>> this succeeds, we could implement a counterpart to the >>> dbus-monitor >>> program in Elisp. And you would be able to access this >>> information >> >> Excellent. I can now parse the output of dbus-monitor. But >> capturing > > Implementation is more complex than expected. Due to its nature, > org.freedesktop.DBus.Monitoring.BecomeMonitor requires another > (parallel) connection to the bus. This is not foreseen yet in > dbusbind.c; > will see how it could fly. > > What I could provide just now is an implementation which runs in > *another* Emacs instance. This could be used for monitoring > only, > because it is another connection to the bus per definition. Are > you > interested to get such a partial implementation? I'm interested in whatever you want to implement. I see signature verification useful for testing rather than an exposed feature. >From what I can see from looking at dbus-monitor output the correct property types are being exposed now. It seems to be working. So whatever we approach we take, the benefit is early warning of future regressions. You are a better judge of benefit of additional effort than I. A second Emacs instance seems to offer the same asynchronous output gathering issues that dbus-monitor poses. It does eliminates the ad-hoc parser. If you have a longer term goal, I'd suggest pursuing that rather than something partial that you'll want to replace later. But I have no objection to a parallel instance to gather request signatures. >> Do you have >> an issue with rolling that up in a macro? > > No objection. But comments :-) > >> (defmacro dbus-test05-test-property (name value expected) >> `(let ((byte-array ,name)) > > I wouldn't call the variable "byte-array"; it could be anything > during > test. Call it "property" or alike. Fixed >> (should >> (equal >> (dbus-register-property >> :session dbus--test-service dbus--test-path >> dbus--test-interface ,name :read > > I would use access type :readwrite. We want also to test > dbus-set-property. Yes, I've added a set property test. I'll move access to a parameter so I can do both positive and negative testing; confirm that :read prevents writes. Which raises the question, should dbus-set-property function call fail for a local property that isn't :readwrite, or should that only be prevented by incoming messages? Do we require that dbus-register-property be used to update a :read access property. >> ,value) >> `((:property :session ,,dbus--test-interface ,,name) >> (,dbus--test-service ,,dbus--test-path)))) > > What are the double commas good for? Typos? I had nested quasi-quoted expressions. I'm working to avoid that. So that was a bug. >> (should >> (equal >> (dbus-get-property >> :session dbus--test-service dbus--test-path >> dbus--test-interface ,name) >> ,expected)) >> >> ;; a test for `dbus-get-property' shall be added. > > That's my typo - dbus-set-property is meant. And yes, it shall > also be > here. So you might need macro arguments value1 expected1 value2 > expected2. I assumed as much. I just carried the comment around blindly. I've changed what I sent you to accept a list of pairs of values and expected return sexps. I use the first pair on the list for dbus-register-property, verify retrieval, then use dbus-set-property to update and verify the property from the remaining pairs. I need more testing and a cleanup pass. I'll pass along a better version when I think it's ready for review. I've started a few "should fail" tests. Cheers, Hugh