branch: externals/async
commit c9bd058b7d42391a06e3d8ffa2357474cd671356
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
DRY in async-inject-variables
* async.el (async-inject-variables): Do it.
---
async.el | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/async.el b/async.el
index 1575a35..020e424 100644
--- a/async.el
+++ b/async.el
@@ -96,13 +96,14 @@ It is intended to be used as follows:
,@(let (bindings)
(mapatoms
(lambda (sym)
- (when (and (boundp sym)
- (or (null include-regexp)
- (string-match include-regexp (symbol-name sym)))
- (or (null exclude-regexp)
- (not (string-match exclude-regexp (symbol-name
sym))))
- (not (string-match "-syntax-table\\'" (symbol-name
sym))))
- (let ((value (symbol-value sym)))
+ (let* ((sname (and (boundp sym) (symbol-name sym)))
+ (value (and sname (symbol-value sym))))
+ (when (and sname
+ (or (null include-regexp)
+ (string-match include-regexp sname))
+ (or (null exclude-regexp)
+ (not (string-match exclude-regexp sname)))
+ (not (string-match "-syntax-table\\'" sname)))
(unless (or (stringp value)
(memq value '(nil t))
(vectorp value))