[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bluetooth 4133a10 13/57: makes mode idempotent
From: |
Stefan Monnier |
Subject: |
[elpa] externals/bluetooth 4133a10 13/57: makes mode idempotent |
Date: |
Thu, 7 Nov 2019 23:28:50 -0500 (EST) |
branch: externals/bluetooth
commit 4133a108e2dc0d62617de50751fabc87a951b941
Author: Raffael Stocker <address@hidden>
Commit: Raffael Stocker <address@hidden>
makes mode idempotent
---
bluetooth.el | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/bluetooth.el b/bluetooth.el
index 2450738..383b2f4 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -365,15 +365,18 @@ This function only uses the first adapter reported by
Bluez."
(defun list-bluetooth-devices ()
"Display a list of Bluetooth devices that are available."
(interactive)
+ ;; make sure D-Bus is (made) available
(dbus-ping :system bluetooth--service bluetooth--timeout)
- (with-current-buffer (switch-to-buffer bluetooth-buffer-name)
- (erase-buffer)
- (bluetooth-mode)
- (bluetooth--register-agent)
- (add-hook 'kill-buffer-hook #'bluetooth--cleanup nil t)
- (set (make-local-variable 'mode-line-misc-info)
- (cl-pushnew bluetooth--mode-info mode-line-misc-info))
- (tabulated-list-print)))
+ (let ((buffer-exists (get-buffer bluetooth-buffer-name)))
+ (with-current-buffer (switch-to-buffer bluetooth-buffer-name)
+ (unless buffer-exists
+ (erase-buffer)
+ (bluetooth-mode)
+ (bluetooth--register-agent)
+ (add-hook 'kill-buffer-hook #'bluetooth--cleanup nil t)
+ (setq-local mode-line-misc-info
+ (cl-pushnew bluetooth--mode-info mode-line-misc-info)))
+ (tabulated-list-print))))
;;; Bluetooth pairing agent code
- [elpa] externals/bluetooth 4a40ee6 24/57: adds GATT UUIDs and a rudimentary display function, (continued)
- [elpa] externals/bluetooth 4a40ee6 24/57: adds GATT UUIDs and a rudimentary display function, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth f33cb12 02/57: Add LICENSE, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth ee4e582 30/57: fixes compiler warnings about unused parameters, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 3365413 33/57: corrects the major mode check in `list-bluetooth-devices', Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth b47bddc 36/57: switches device-info buffer to special mode, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 42a9487 35/57: moves `hl-line-mode' to end of init so hl is shown at startup, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 325febd 16/57: adds Imenu integration to Readme feature list, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth f0e5047 18/57: removes unnecessary quotes before lambdas and corrects indentation, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 738347b 19/57: adds TAGS to .gitignore, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 28e9eb2 21/57: wraps @body in progn in bluetooth--maybe-cancel-reject, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 4133a10 13/57: makes mode idempotent,
Stefan Monnier <=
- [elpa] externals/bluetooth 3c25a8c 23/57: adds basic service class UUID parsing, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 5219f05 31/57: fixes a compile error and adds customization, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 0108cbd 32/57: uses `read-from-minibuffer' instead of `read-passwd', Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 1ec2997 22/57: uses the correct bus (:system) for the callback methods, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 83344c8 20/57: cleans up display code, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth fe926e9 28/57: puts functions before the long uuid defconsts for readability, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth c473128 40/57: adds repository URL to mode (entry) command docstring, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth eb1d4ea 25/57: adds UUID and service/device class parsing and display, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth f9bfd26 39/57: fixes a grammatical mistake in Readme.org, Stefan Monnier, 2019/11/07
- [elpa] externals/bluetooth 565cfec 38/57: adds more elaborate usage information, Stefan Monnier, 2019/11/07