[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bluetooth f81cb13 04/33: removes unnecessary `save-matc
From: |
Stefan Monnier |
Subject: |
[elpa] externals/bluetooth f81cb13 04/33: removes unnecessary `save-match-data' invocations |
Date: |
Sat, 19 Sep 2020 08:43:19 -0400 (EDT) |
branch: externals/bluetooth
commit f81cb139eda56d52b7879cd136b5fdaa9dfeaaee
Author: Raffael Stocker <r.stocker@mnet-mail.de>
Commit: Raffael Stocker <r.stocker@mnet-mail.de>
removes unnecessary `save-match-data' invocations
---
bluetooth.el | 47 ++++++++++++++++++++++-------------------------
1 file changed, 22 insertions(+), 25 deletions(-)
diff --git a/bluetooth.el b/bluetooth.el
index 173076e..262a412 100644
--- a/bluetooth.el
+++ b/bluetooth.el
@@ -127,12 +127,11 @@ This is usually `:system' if bluetoothd runs as a system
service, or
(defun bluetooth--function-name (name &optional prefix)
"Make a function name out of NAME and PREFIX.
The generated function name has the form `bluetoothPREFIX-NAME'."
- (save-match-data
- (concat "bluetooth"
- prefix
- (replace-regexp-in-string "[[:upper:]][[:lower:]]+"
- (lambda (x) (concat "-" (downcase x)))
- name t)))))
+ (concat "bluetooth"
+ prefix
+ (replace-regexp-in-string "[[:upper:]][[:lower:]]+"
+ (lambda (x) (concat "-" (downcase x)))
+ name t))))
(defmacro bluetooth-defun-method (method api docstring)
(declare (doc-string 3) (indent 2))
@@ -477,18 +476,17 @@ scanning the bus, displaying device info etc."
"Request a pin code for DEVICE."
(bluetooth--maybe-cancel-reject
(bluetooth--with-alias device
- (save-match-data
- (let* ((pin (read-from-minibuffer
- (format "Enter Bluetooth PIN for `%s': " alias)))
- (trimmed-pin (substring pin 0 (min (length pin) 16)))
- (case-fold-search nil))
- (cond ((= 0 (length trimmed-pin))
- (message "PIN has zero length")
- nil)
- ((string-match "[^[:alnum:]]" trimmed-pin)
- (message "PIN contains non-alphanumeric characters")
- nil)
- (t trimmed-pin)))))))
+ (let* ((pin (read-from-minibuffer
+ (format "Enter Bluetooth PIN for `%s': " alias)))
+ (trimmed-pin (substring pin 0 (min (length pin) 16)))
+ (case-fold-search nil))
+ (cond ((= 0 (length trimmed-pin))
+ (message "PIN has zero length")
+ nil)
+ ((string-match "[^[:alnum:]]" trimmed-pin)
+ (message "PIN contains non-alphanumeric characters")
+ nil)
+ (t trimmed-pin))))))
(defun bluetooth--display-pin-code (device pincode)
"Display the PINCODE for DEVICE."
@@ -1366,13 +1364,12 @@ scanning the bus, displaying device info etc."
"Parse UUID and return short and long service class names."
(let ((uuid-re (rx (seq bos (submatch (= 8 xdigit))
"-" (eval bluetooth--base-uuid) eos))))
- (save-match-data
- (when (string-match uuid-re uuid)
- (let ((service-id (string-to-number (match-string 1 uuid) 16)))
- (or (gethash service-id
- (cdr (-find (lambda (x) (>= service-id (car x)))
- bluetooth--uuid-alists)))
- (list (format "#x%08x" service-id) "unknown")))))))
+ (when (string-match uuid-re uuid)
+ (let ((service-id (string-to-number (match-string 1 uuid) 16)))
+ (or (gethash service-id
+ (cdr (-find (lambda (x) (>= service-id (car x)))
+ bluetooth--uuid-alists)))
+ (list (format "#x%08x" service-id) "unknown"))))))
(defun bluetooth--parse-class (class)
"Parse the CLASS property of a Bluetooth device."
- [elpa] externals/bluetooth updated (9ea7bad -> 28d16f6), Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 8d4b762 01/33: fixes indent declaration in macros, generalises function name regexp, Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 94d9827 05/33: displays MAC address if alias is unknown (pairing agent), Stefan Monnier, 2020/09/19
- [elpa] externals/bluetooth 2f8f31c 08/33: adds an unload function, Stefan Monnier, 2020/09/19
- [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 <=
- [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, 2020/09/19
- [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