[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bluetooth 8f3dcaa 11/33: move some of the comments into
From: |
Stefan Monnier |
Subject: |
[elpa] externals/bluetooth 8f3dcaa 11/33: move some of the comments into docstrings |
Date: |
Sat, 19 Sep 2020 08:43:21 -0400 (EDT) |
branch: externals/bluetooth
commit 8f3dcaab73dee361b1f64c2424c062b78415bb24
Author: Raffael Stocker <r.stocker@mnet-mail.de>
Commit: Raffael Stocker <r.stocker@mnet-mail.de>
move some of the comments into docstrings
---
bluetooth.el | 40 +++++++++++++++++++++++-----------------
1 file changed, 23 insertions(+), 17 deletions(-)
diff --git a/bluetooth.el b/bluetooth.el
index 33e5ed4..9816371 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -78,17 +78,22 @@ This is usually `:system' if bluetoothd runs as a system
service, or
(put 'bluetooth--mode-info 'risky-local-variable t)
-;; The state information list defines the kind of adapter state displayed
-;; in the mode-line. The first element of a sublist is an adapter property,
-;; the second is a list containing first the current status of the item
(t/nil),
-;; second the displayed string if the property is non-nil and
-;; third the displayed string if the property is nil. If a
-;; display element is nil, nothing will be displayed for this property.
+
(defvar bluetooth--mode-state '(("Powered" . (nil nil "off"))
("Discoverable" . (nil "discoverable" nil))
("Pairable" . (nil "pairable" nil))
("Discovering" . (nil "scan" nil)))
- "Mode line adapter state information.")
+ "Mode line adapter state information.
+
+The state information list defines the kind of adapter state
+displayed in the mode-line. The first element of each sub-list
+is an adapter property, the second is a list containing the
+ - current status of the item (t or nil),
+ - string displayed if the property is non-nil,
+ - string displayed if the property is nil.
+
+If a display element is nil, nothing will be displayed for this
+property and state.")
;; Bluez service name as defined by the Bluez API
(defconst bluetooth--service "org.bluez" "D-Bus service name of Bluez.")
@@ -219,12 +224,13 @@ The generated function name has the form
`bluetoothPREFIX-NAME'."
((null value) "no")
(t "yes"))))
-;; List format for the main display buffer.
-;; NOTE: the strings MUST correspond to Bluez device properties
-;; as they are used to gather the information from Bluez.
(defconst bluetooth--list-format
[("Alias" 24 t) ("Paired" 8 t) ("Connected" 11 t) ("Address" 17 t)
- ("Blocked" 9 t) ("Trusted" 9 t)] "The list view format for bluetooth mode.")
+ ("Blocked" 9 t) ("Trusted" 9 t)]
+ "The list view format for bluetooth mode.
+
+NOTE: the strings MUST correspond to Bluez device properties
+as they are used to gather the information from Bluez.")
;; This function provides the list entries for the tabulated-list
;; view. It is called from `tabulated-list-print'.
@@ -400,11 +406,10 @@ This function only uses the first adapter reported by
Bluez."
(unless (string-blank-p info)
(concat " [" info "]"))))
-;; This D-Bus signal handler listens to property changes of the
-;; adapter and updates the status display accordingly.
(defun bluetooth--handle-prop-change (interface data &rest _)
"Handle property change signals on D-Bus INTERFACE as given by DATA.
-Only adapter properties are considered."
+Only adapter properties are considered. If an adapter property changes,
+update the status display accordingly."
(when (string= interface (alist-get :adapter bluetooth--interfaces))
(dolist (elt data)
(let ((prop (car elt))
@@ -412,10 +417,11 @@ Only adapter properties are considered."
(when-let (state (cdr (assoc prop bluetooth--mode-state)))
(setcar state value))))))
-;; This function registers a signal handler for the _first_ adapter
-;; reported by Bluez.
(defun bluetooth--register-signal-handler ()
- "Register signal handler for adapter property changes."
+ "Register a signal handler for adapter property changes.
+
+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)))
- [elpa] externals/bluetooth b60b76c 10/33: add Makefile and remove now unused bluetooth-test* files, (continued)
- [elpa] externals/bluetooth b60b76c 10/33: add Makefile and remove now unused bluetooth-test* files, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth e15f6d0 14/33: Revert "add local variable for flycheck mode", Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 1649156 06/33: removes incorrect mode-info clean-up, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 1758202 18/33: correct indentation, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth e95f30b 20/33: avoid using undocumented value of ‘push’, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 24d3c4a 03/33: fixes column widths in list format so sorting arrows are visible, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth f81cb13 04/33: removes unnecessary `save-match-data' invocations, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 6813a70 02/33: fixes comments to conform to Elisp conventions, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth fba1988 07/33: adds a simple compile/test setup script, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 53323b9 09/33: matches case sensitively in bluetooth--function-name, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 8f3dcaa 11/33: move some of the comments into docstrings,
Stefan Monnier <=
- [elpa] externals/bluetooth e86e01f 12/33: add local variable for flycheck mode, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth f107d6f 13/33: Add menu entries to bluetooth-mode-map, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth eb4b158 15/33: Merge commit 'f107d6f', Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth b12caf1 16/33: update author list, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 5d72618 17/33: add page breaks and section headings, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 8e8b6d0 19/33: bump up the copyright year, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 943ddf3 21/33: Clean up the UUID and class descriptions, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 98afd71 22/33: add property and uuid functions, update info display, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 518ebdf 29/33: update company ids (bluetooth--manufacturer-ids), Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 2746c62 23/33: change connect and disconnect functions to handle single profiles, Stefan Monnier, 2020/09/19