branch: externals/bluetooth commit 33654137458cdafc6560da2ecb00748f98f54357 Author: Raffael Stocker <r.stoc...@mnet-mail.de> Commit: Raffael Stocker <r.stoc...@mnet-mail.de>
corrects the major mode check in `list-bluetooth-devices' --- bluetooth.el | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/bluetooth.el b/bluetooth.el index 2b77d25..f341a88 100644 --- a/bluetooth.el +++ b/bluetooth.el @@ -400,17 +400,16 @@ This function only uses the first adapter reported by Bluez." (interactive) ;; make sure D-Bus is (made) available (dbus-ping bluetooth-bluez-bus bluetooth--service bluetooth--timeout) - (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) - (make-local-variable 'mode-line-misc-info) - (cl-pushnew bluetooth--mode-info mode-line-misc-info) - (setq imenu-create-index-function #'bluetooth--create-imenu-index)) - (tabulated-list-print t)))) + (with-current-buffer (switch-to-buffer bluetooth-buffer-name) + (unless (eq major-mode 'bluetooth-mode) + (erase-buffer) + (bluetooth-mode) + (bluetooth--register-agent) + (add-hook 'kill-buffer-hook #'bluetooth--cleanup nil t) + (make-local-variable 'mode-line-misc-info) + (cl-pushnew bluetooth--mode-info mode-line-misc-info) + (setq imenu-create-index-function #'bluetooth--create-imenu-index)) + (tabulated-list-print t))) ;;; Bluetooth pairing agent code