]> code.delx.au - gnu-emacs-elpa/commitdiff
Fixed async-smtpmail-send-it
authorJohn Wiegley <johnw@newartisans.com>
Tue, 19 Jun 2012 03:21:09 +0000 (22:21 -0500)
committerJohn Wiegley <johnw@newartisans.com>
Tue, 19 Jun 2012 03:21:09 +0000 (22:21 -0500)
async.el
smtpmail-async.el

index 2c6707b6f9f285ab99cbc22e695ce39ac56133b9..e5f5f6a9506f3481f25d0262235ce7589df6c041 100644 (file)
--- a/async.el
+++ b/async.el
 (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."
index 71f03e43d70de31cbeafbe669ac2ff74fad260fa..42fb6d77a1df614c9f15164154cfe49521cb5797 100644 (file)
 (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)