branch: externals/bluetooth
commit 94d9827b8853ba3f698766207ba8ff39082524c0
Author: Raffael Stocker <[email protected]>
Commit: Raffael Stocker <[email protected]>
displays MAC address if alias is unknown (pairing agent)
---
bluetooth.el | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/bluetooth.el b/bluetooth.el
index 262a412..e12ceb1 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -457,9 +457,10 @@ scanning the bus, displaying device info etc."
(defmacro bluetooth--with-alias (device &rest body)
"Evaluate BODY with DEVICE alias bound to ALIAS."
(declare (indent defun))
- `(let ((alias (bluetooth--call-method
- (car (last (split-string ,device "/"))) :device
- #'dbus-get-property "Alias")))
+ `(let* ((dev (car (last (split-string ,device "/"))))
+ (alias (or (bluetooth--call-method dev :device
+ #'dbus-get-property "Alias")
+ (replace-regexp-in-string "_" ":" dev nil nil nil 4))))
,@body))
(defmacro bluetooth--maybe-cancel-reject (&rest body)