branch: master
commit 190a0406536ca975347252da2646d7d889f60ef8
Author: John Wiegley <[email protected]>
Commit: John Wiegley <[email protected]>
Fixed async-smtpmail-send-it
---
async.el | 41 ++++++++++++++++++++---------------------
smtpmail-async.el | 19 +++++++++----------
2 files changed, 29 insertions(+), 31 deletions(-)
diff --git a/async.el b/async.el
index 2c6707b..e5f5f6a 100644
--- a/async.el
+++ b/async.el
@@ -75,27 +75,26 @@
(defmacro async-inject-environment
(include-regexp &optional predicate exclude-regexp)
"Inject a part of the parent environment into an async function."
- `(setq
- ,@(let (bindings)
- (mapatoms
- (lambda (sym)
- (if (and (boundp sym)
- (or (null include-regexp)
- (string-match include-regexp (symbol-name sym)))
- (not (string-match
- (or exclude-regexp "-syntax-table\\'")
- (symbol-name sym))))
- (let ((value (symbol-value sym)))
- (when (or (null predicate)
- (funcall (or predicate
- (lambda (sym)
- (let ((value (symbol-value sym)))
- (or (not (functionp value))
- (symbolp value))))) sym))
- (setq bindings (cons `(quote ,value)
- bindings))
- (setq bindings (cons sym bindings)))))))
- bindings)))
+ `'(setq
+ ,@(let (bindings)
+ (mapatoms
+ (lambda (sym)
+ (if (and (boundp sym)
+ (or (null include-regexp)
+ (string-match include-regexp (symbol-name sym)))
+ (not (string-match
+ (or exclude-regexp "-syntax-table\\'")
+ (symbol-name sym))))
+ (let ((value (symbol-value sym)))
+ (when (funcall (or predicate
+ (lambda (sym)
+ (let ((value (symbol-value sym)))
+ (or (not (functionp value))
+ (symbolp value)))))
+ sym)
+ (setq bindings (cons `(quote ,value) bindings)
+ bindings (cons sym bindings)))))))
+ bindings)))
(defun async-when-done (proc &optional change)
"Process sentinal used to retrieve the value from the child process."
diff --git a/smtpmail-async.el b/smtpmail-async.el
index 71f03e4..42fb6d7 100644
--- a/smtpmail-async.el
+++ b/smtpmail-async.el
@@ -42,16 +42,15 @@
(require 'smtpmail)
(defun async-smtpmail-send-it ()
- (macroexpand
- '(async-start
- `(lambda ()
- (require 'smtpmail)
- (with-temp-buffer
- (insert ,(buffer-substring-no-properties (point-min) (point-max)))
- ;; Pass in the variable environment for smtpmail
- (async-inject-environment "\\`\\(smtpmail\\|\\(user-\\)?mail\\)-")
- (smtpmail-send-it)))
- 'ignore)))
+ (async-start
+ `(lambda ()
+ (require 'smtpmail)
+ (with-temp-buffer
+ (insert ,(buffer-substring-no-properties (point-min) (point-max)))
+ ;; Pass in the variable environment for smtpmail
+ ,(async-inject-environment "\\`\\(smtpmail\\|\\(user-\\)?mail\\)-")
+ (smtpmail-send-it)))
+ 'ignore))
(provide 'smtpmail-async)