emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/bluetooth f75ac5e43d 11/32: clean up the method registr


From: Stefan Kangas
Subject: [elpa] externals/bluetooth f75ac5e43d 11/32: clean up the method registration function
Date: Mon, 3 Jan 2022 15:11:07 -0500 (EST)

branch: externals/bluetooth
commit f75ac5e43d6cc23b2ebd29b9c5436edcd576e4a2
Author: Raffael Stocker <r.stocker@mnet-mail.de>
Commit: Raffael Stocker <r.stocker@mnet-mail.de>

    clean up the method registration function
---
 bluetooth.el | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/bluetooth.el b/bluetooth.el
index 081751558c..b8fb11c6a2 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -643,7 +643,7 @@ scanning the bus, displaying device info etc."
          (bluetooth-mode)
          (setq bluetooth--device-info (make-hash-table :test #'equal))
          (bluetooth--update-device-info)
-         (bluetooth--register-agent)
+         (setq bluetooth--method-objects (bluetooth--register-agent))
          (cl-pushnew bluetooth--mode-info mode-line-process)
          (add-hook 'kill-buffer-hook #'bluetooth--cleanup nil t)
          (setq imenu-create-index-function #'bluetooth--create-imenu-index)
@@ -754,21 +754,21 @@ scanning the bus, displaying device info etc."
   (let ((methods '("Release" "RequestPinCode" "DisplayPinCode"
                                   "RequestPasskey" "DisplayPasskey" 
"RequestConfirmation"
                                   "RequestAuthorization" "AuthorizeService" 
"Cancel")))
-       (setq bluetooth--method-objects
-                 (cl-loop for method in methods
-                                  for fname = (bluetooth--function-name method 
"-")
-                                  collect (dbus-register-method 
bluetooth-bluez-bus
-                                                                               
                 dbus-service-emacs
-                                                                               
                 bluetooth--own-path
-                                                                               
                 (alist-get
-                                                                               
                  :agent
-                                                                               
                  bluetooth--interfaces)
-                                                                               
                 method (intern fname) t))))
-  (dbus-register-service :session dbus-service-emacs)
-  (dbus-call-method bluetooth-bluez-bus bluetooth--service bluetooth--root
-                                       (alist-get :agent-manager 
bluetooth--interfaces)
-                                       "RegisterAgent"
-                                       :object-path bluetooth--own-path 
"KeyboardDisplay"))
+       (prog1 
+               (cl-loop for method in methods
+                                for fname = (bluetooth--function-name method 
"-")
+                                collect (dbus-register-method 
bluetooth-bluez-bus
+                                                                               
           dbus-service-emacs
+                                                                               
           bluetooth--own-path
+                                                                               
           (alist-get
+                                                                               
                :agent
+                                                                               
                bluetooth--interfaces)
+                                                                               
           method (intern fname) t))
+         (dbus-register-service :session dbus-service-emacs)
+         (dbus-call-method bluetooth-bluez-bus bluetooth--service 
bluetooth--root
+                                               (alist-get :agent-manager 
bluetooth--interfaces)
+                                               "RegisterAgent"
+                                               :object-path 
bluetooth--own-path "KeyboardDisplay"))))
 
 
 ;;;; service and class UUID definitions



reply via email to

[Prev in Thread] Current Thread [Next in Thread]