[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bluetooth ada89f2faa 10/32: clean up the signal handler
From: |
Stefan Kangas |
Subject: |
[elpa] externals/bluetooth ada89f2faa 10/32: clean up the signal handler function |
Date: |
Mon, 3 Jan 2022 15:11:07 -0500 (EST) |
branch: externals/bluetooth
commit ada89f2faa99980bfdf7436c209cdc26bbf49e54
Author: Raffael Stocker <r.stocker@mnet-mail.de>
Commit: Raffael Stocker <r.stocker@mnet-mail.de>
clean up the signal handler function
---
bluetooth.el | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/bluetooth.el b/bluetooth.el
index 1d3f0bb402..081751558c 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -596,21 +596,18 @@ update the status display accordingly."
This function registers a signal handler only for the first
adapter reported by Bluez."
- (let ((adapters (dbus-introspect-get-node-names bluetooth-bluez-bus
-
bluetooth--service
-
bluetooth--root)))
- (setq bluetooth--adapter-signal
- (dbus-register-signal bluetooth-bluez-bus
- nil
- (concat
bluetooth--root "/"
-
(car adapters))
- (alist-get
:properties
-
bluetooth--interfaces)
-
"PropertiesChanged"
-
#'bluetooth--handle-prop-change
- :arg-namespace
- (alist-get
:adapter
-
bluetooth--interfaces)))))
+ (let ((adapter (cl-first (bluetooth--adapters))))
+ (dbus-register-signal bluetooth-bluez-bus
+ nil
+ (concat bluetooth--root "/"
+ adapter)
+ (alist-get :properties
+
bluetooth--interfaces)
+ "PropertiesChanged"
+
#'bluetooth--handle-prop-change
+ :arg-namespace
+ (alist-get :adapter
+
bluetooth--interfaces))))
(defun bluetooth--device-uuids (properties)
"Extract a UUID alist from device PROPERTIES.
@@ -651,7 +648,8 @@ scanning the bus, displaying device info etc."
(add-hook 'kill-buffer-hook #'bluetooth--cleanup nil t)
(setq imenu-create-index-function #'bluetooth--create-imenu-index)
(bluetooth--initialize-mode-info)
- (bluetooth--register-signal-handler))))
+ (setq bluetooth--adapter-signal
+ (bluetooth--register-signal-handler)))))
;;;; Bluetooth pairing agent code
- [elpa] externals/bluetooth updated (4c7d18c99b -> 7ed3db7260), Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth 6aebc228b5 02/32: fix a typo in the info display, Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth 72cb48584f 01/32: widen address field in tab view to accommodate var-pitch fonts, Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth 3d0fe7ed9d 09/32: use a struct for the adapter property display in the mode line, Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth ada89f2faa 10/32: clean up the signal handler function,
Stefan Kangas <=
- [elpa] externals/bluetooth f971b21d66 03/32: use a structure and hash table for device-info, Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth 8edeb34f61 05/32: add bluetooth--adapter-properties function, Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth bd95b1ca0b 15/32: revert to mapc instead of --map when used for side-effects only, Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth 273306e1e0 25/32: update the list view more intelligently, Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth 9878aa8051 14/32: add adapter parameters in adapter-properties and devices functions, Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth f2d43ebab5 16/32: make bluetooth--choose-uuid somewhat more readable, Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth 5a49391b00 07/32: clean up device property handling (breaks info view code), Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth 0627cceab3 08/32: clean up the info view code and add an adapter info view, Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth f75ac5e43d 11/32: clean up the method registration function, Stefan Kangas, 2022/01/03
- [elpa] externals/bluetooth e69e4151ff 12/32: clean things up for readability, Stefan Kangas, 2022/01/03