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

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

[elpa] externals/bluetooth 94d9827 05/33: displays MAC address if alias


From: Stefan Monnier
Subject: [elpa] externals/bluetooth 94d9827 05/33: displays MAC address if alias is unknown (pairing agent)
Date: Sat, 19 Sep 2020 08:43:20 -0400 (EDT)

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

    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)



reply via email to

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